Index: trunk/extensions/Translate/SpecialImportTranslations.php |
— | — | @@ -102,7 +102,10 @@ |
103 | 103 | * Constructs and outputs file input form with supported methods. |
104 | 104 | */ |
105 | 105 | protected function outputForm() { |
106 | | - $this->out->addScriptClass( 'TranslateImport' ); |
| 106 | + global $wgScriptPath; |
| 107 | + // Core jQuery |
| 108 | + $this->out->addScriptFile( "$wgScriptPath/extensions/Translate/js/js2stopgap.js" ); |
| 109 | + $this->out->addScriptFile( "$wgScriptPath/extensions/Translate/js/import.js" ); |
107 | 110 | |
108 | 111 | // Ugly but necessary form building ahead, ohoy |
109 | 112 | $this->out->addHTML( |
— | — | @@ -118,8 +121,7 @@ |
119 | 122 | ); |
120 | 123 | |
121 | 124 | $class = array( 'class' => 'mw-translate-import-inputs' ); |
122 | | - global $wgAllowCopyUploads; |
123 | | - if ( $wgAllowCopyUploads ) { |
| 125 | + if ( true ) { |
124 | 126 | $this->out->addHTML( |
125 | 127 | Xml::radioLabel( wfMsg( 'translate-import-from-url' ), |
126 | 128 | 'upload-type', 'url', 'mw-translate-up-url', |
— | — | @@ -162,16 +164,13 @@ |
163 | 165 | $source = $this->request->getText( 'upload-type' ); |
164 | 166 | |
165 | 167 | if ( $source === 'url' ) { |
166 | | - global $wgAllowCopyUploads; |
167 | | - if ( !$wgAllowCopyUploads ) return array( 'type-not-supported', $source ); |
168 | | - |
| 168 | + #return array( 'type-not-supported', $source ); |
169 | 169 | $url = $this->request->getText( 'upload-url' ); |
170 | | - $status = Http::doDownload( $url, false ); |
171 | | - if ( $status->isOk() ) { |
172 | | - $filedata = $status->value; |
| 170 | + $filedata = Http::get( $url );; |
| 171 | + if ( $filedata ) { |
173 | 172 | return array( 'ok' ); |
174 | 173 | } else { |
175 | | - return array( 'dl-failed', $status->getWikiText() ); |
| 174 | + return array( 'dl-failed', 'Unknown reason' ); |
176 | 175 | } |
177 | 176 | } elseif ( $source === 'local' ) { |
178 | 177 | $filename = $this->request->getFileTempname( 'upload-local' ); |
Index: trunk/extensions/Translate/js/js2stopgap.js |
— | — | @@ -0,0 +1,9509 @@ |
| 2 | +/*! |
| 3 | + * jQuery JavaScript Library v1.3.2 |
| 4 | + * http://jquery.com/ |
| 5 | + * |
| 6 | + * Copyright (c) 2009 John Resig |
| 7 | + * Dual licensed under the MIT and GPL licenses. |
| 8 | + * http://docs.jquery.com/License |
| 9 | + * |
| 10 | + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) |
| 11 | + * Revision: 6246 |
| 12 | + */ |
| 13 | +( function() { |
| 14 | + |
| 15 | +var |
| 16 | + // Will speed up references to window, and allows munging its name. |
| 17 | + window = this, |
| 18 | + // Will speed up references to undefined, and allows munging its name. |
| 19 | + undefined, |
| 20 | + // Map over jQuery in case of overwrite |
| 21 | + _jQuery = window.jQuery, |
| 22 | + // Map over the $ in case of overwrite |
| 23 | + _$ = window.$, |
| 24 | + |
| 25 | + jQuery = window.jQuery = window.$ = function( selector, context ) { |
| 26 | + // The jQuery object is actually just the init constructor 'enhanced' |
| 27 | + return new jQuery.fn.init( selector, context ); |
| 28 | + }, |
| 29 | + |
| 30 | + // A simple way to check for HTML strings or ID strings |
| 31 | + // (both of which we optimize for) |
| 32 | + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, |
| 33 | + // Is it a simple selector |
| 34 | + isSimple = / ^ .[ ^ :# \[\.,]*$/; |
| 35 | + |
| 36 | +jQuery.fn = jQuery.prototype = { |
| 37 | + init: function( selector, context ) { |
| 38 | + // Make sure that a selection was provided |
| 39 | + selector = selector || document; |
| 40 | + |
| 41 | + // Handle $(DOMElement) |
| 42 | + if ( selector.nodeType ) { |
| 43 | + this[0] = selector; |
| 44 | + this.length = 1; |
| 45 | + this.context = selector; |
| 46 | + return this; |
| 47 | + } |
| 48 | + // Handle HTML strings |
| 49 | + if ( typeof selector === "string" ) { |
| 50 | + // Are we dealing with HTML string or an ID? |
| 51 | + var match = quickExpr.exec( selector ); |
| 52 | + |
| 53 | + // Verify a match, and that no context was specified for #id |
| 54 | + if ( match && ( match[1] || !context ) ) { |
| 55 | + |
| 56 | + // HANDLE: $(html) -> $(array) |
| 57 | + if ( match[1] ) |
| 58 | + selector = jQuery.clean( [ match[1] ], context ); |
| 59 | + |
| 60 | + // HANDLE: $("#id") |
| 61 | + else { |
| 62 | + var elem = document.getElementById( match[3] ); |
| 63 | + |
| 64 | + // Handle the case where IE and Opera return items |
| 65 | + // by name instead of ID |
| 66 | + if ( elem && elem.id != match[3] ) |
| 67 | + return jQuery().find( selector ); |
| 68 | + |
| 69 | + // Otherwise, we inject the element directly into the jQuery object |
| 70 | + var ret = jQuery( elem || [] ); |
| 71 | + ret.context = document; |
| 72 | + ret.selector = selector; |
| 73 | + return ret; |
| 74 | + } |
| 75 | + |
| 76 | + // HANDLE: $(expr, [context]) |
| 77 | + // (which is just equivalent to: $(content).find(expr) |
| 78 | + } else |
| 79 | + return jQuery( context ).find( selector ); |
| 80 | + |
| 81 | + // HANDLE: $(function) |
| 82 | + // Shortcut for document ready |
| 83 | + } else if ( jQuery.isFunction( selector ) ) |
| 84 | + return jQuery( document ).ready( selector ); |
| 85 | + |
| 86 | + // Make sure that old selector state is passed along |
| 87 | + if ( selector.selector && selector.context ) { |
| 88 | + this.selector = selector.selector; |
| 89 | + this.context = selector.context; |
| 90 | + } |
| 91 | + |
| 92 | + return this.setArray( jQuery.isArray( selector ) ? |
| 93 | + selector : |
| 94 | + jQuery.makeArray( selector ) ); |
| 95 | + }, |
| 96 | + |
| 97 | + // Start with an empty selector |
| 98 | + selector: "", |
| 99 | + |
| 100 | + // The current version of jQuery being used |
| 101 | + jquery: "1.3.2", |
| 102 | + |
| 103 | + // The number of elements contained in the matched element set |
| 104 | + size: function() { |
| 105 | + return this.length; |
| 106 | + }, |
| 107 | + |
| 108 | + // Get the Nth element in the matched element set OR |
| 109 | + // Get the whole matched element set as a clean array |
| 110 | + get: function( num ) { |
| 111 | + return num === undefined ? |
| 112 | + |
| 113 | + // Return a 'clean' array |
| 114 | + Array.prototype.slice.call( this ) : |
| 115 | + |
| 116 | + // Return just the object |
| 117 | + this[ num ]; |
| 118 | + }, |
| 119 | + |
| 120 | + // Take an array of elements and push it onto the stack |
| 121 | + // (returning the new matched element set) |
| 122 | + pushStack: function( elems, name, selector ) { |
| 123 | + // Build a new jQuery matched element set |
| 124 | + var ret = jQuery( elems ); |
| 125 | + |
| 126 | + // Add the old object onto the stack (as a reference) |
| 127 | + ret.prevObject = this; |
| 128 | + |
| 129 | + ret.context = this.context; |
| 130 | + |
| 131 | + if ( name === "find" ) |
| 132 | + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; |
| 133 | + else if ( name ) |
| 134 | + ret.selector = this.selector + "." + name + "(" + selector + ")"; |
| 135 | + |
| 136 | + // Return the newly-formed element set |
| 137 | + return ret; |
| 138 | + }, |
| 139 | + |
| 140 | + // Force the current matched set of elements to become |
| 141 | + // the specified array of elements (destroying the stack in the process) |
| 142 | + // You should use pushStack() in order to do this, but maintain the stack |
| 143 | + setArray: function( elems ) { |
| 144 | + // Resetting the length to 0, then using the native Array push |
| 145 | + // is a super-fast way to populate an object with array-like properties |
| 146 | + this.length = 0; |
| 147 | + Array.prototype.push.apply( this, elems ); |
| 148 | + |
| 149 | + return this; |
| 150 | + }, |
| 151 | + |
| 152 | + // Execute a callback for every element in the matched set. |
| 153 | + // (You can seed the arguments with an array of args, but this is |
| 154 | + // only used internally.) |
| 155 | + each: function( callback, args ) { |
| 156 | + return jQuery.each( this, callback, args ); |
| 157 | + }, |
| 158 | + |
| 159 | + // Determine the position of an element within |
| 160 | + // the matched set of elements |
| 161 | + index: function( elem ) { |
| 162 | + // Locate the position of the desired element |
| 163 | + return jQuery.inArray( |
| 164 | + // If it receives a jQuery object, the first element is used |
| 165 | + elem && elem.jquery ? elem[0] : elem |
| 166 | + , this ); |
| 167 | + }, |
| 168 | + |
| 169 | + attr: function( name, value, type ) { |
| 170 | + var options = name; |
| 171 | + |
| 172 | + // Look for the case where we're accessing a style value |
| 173 | + if ( typeof name === "string" ) |
| 174 | + if ( value === undefined ) |
| 175 | + return this[0] && jQuery[ type || "attr" ]( this[0], name ); |
| 176 | + |
| 177 | + else { |
| 178 | + options = { }; |
| 179 | + options[ name ] = value; |
| 180 | + } |
| 181 | + |
| 182 | + // Check to see if we're setting style values |
| 183 | + return this.each( function( i ) { |
| 184 | + // Set all the styles |
| 185 | + for ( name in options ) |
| 186 | + jQuery.attr( |
| 187 | + type ? |
| 188 | + this.style : |
| 189 | + this, |
| 190 | + name, jQuery.prop( this, options[ name ], type, i, name ) |
| 191 | + ); |
| 192 | + } ); |
| 193 | + }, |
| 194 | + |
| 195 | + css: function( key, value ) { |
| 196 | + // ignore negative width and height values |
| 197 | + if ( ( key == 'width' || key == 'height' ) && parseFloat( value ) < 0 ) |
| 198 | + value = undefined; |
| 199 | + return this.attr( key, value, "curCSS" ); |
| 200 | + }, |
| 201 | + |
| 202 | + text: function( text ) { |
| 203 | + if ( typeof text !== "object" && text != null ) |
| 204 | + return this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( text ) ); |
| 205 | + |
| 206 | + var ret = ""; |
| 207 | + |
| 208 | + jQuery.each( text || this, function() { |
| 209 | + jQuery.each( this.childNodes, function() { |
| 210 | + if ( this.nodeType != 8 ) |
| 211 | + ret += this.nodeType != 1 ? |
| 212 | + this.nodeValue : |
| 213 | + jQuery.fn.text( [ this ] ); |
| 214 | + } ); |
| 215 | + } ); |
| 216 | + |
| 217 | + return ret; |
| 218 | + }, |
| 219 | + |
| 220 | + wrapAll: function( html ) { |
| 221 | + if ( this[0] ) { |
| 222 | + // The elements to wrap the target around |
| 223 | + var wrap = jQuery( html, this[0].ownerDocument ). clone (); |
| 224 | + |
| 225 | + if ( this[0].parentNode ) |
| 226 | + wrap.insertBefore( this[0] ); |
| 227 | + |
| 228 | + wrap.map( function() { |
| 229 | + var elem = this; |
| 230 | + |
| 231 | + while ( elem.firstChild ) |
| 232 | + elem = elem.firstChild; |
| 233 | + |
| 234 | + return elem; |
| 235 | + } ).append( this ); |
| 236 | + } |
| 237 | + |
| 238 | + return this; |
| 239 | + }, |
| 240 | + |
| 241 | + wrapInner: function( html ) { |
| 242 | + return this.each( function() { |
| 243 | + jQuery( this ).contents().wrapAll( html ); |
| 244 | + } ); |
| 245 | + }, |
| 246 | + |
| 247 | + wrap: function( html ) { |
| 248 | + return this.each( function() { |
| 249 | + jQuery( this ).wrapAll( html ); |
| 250 | + } ); |
| 251 | + }, |
| 252 | + |
| 253 | + append: function() { |
| 254 | + return this.domManip( arguments, true, function( elem ) { |
| 255 | + if ( this.nodeType == 1 ) |
| 256 | + this.appendChild( elem ); |
| 257 | + } ); |
| 258 | + }, |
| 259 | + |
| 260 | + prepend: function() { |
| 261 | + return this.domManip( arguments, true, function( elem ) { |
| 262 | + if ( this.nodeType == 1 ) |
| 263 | + this.insertBefore( elem, this.firstChild ); |
| 264 | + } ); |
| 265 | + }, |
| 266 | + |
| 267 | + before: function() { |
| 268 | + return this.domManip( arguments, false, function( elem ) { |
| 269 | + this.parentNode.insertBefore( elem, this ); |
| 270 | + } ); |
| 271 | + }, |
| 272 | + |
| 273 | + after: function() { |
| 274 | + return this.domManip( arguments, false, function( elem ) { |
| 275 | + this.parentNode.insertBefore( elem, this.nextSibling ); |
| 276 | + } ); |
| 277 | + }, |
| 278 | + |
| 279 | + end: function() { |
| 280 | + return this.prevObject || jQuery( [] ); |
| 281 | + }, |
| 282 | + |
| 283 | + // For internal use only. |
| 284 | + // Behaves like an Array's method, not like a jQuery method. |
| 285 | + push: [].push, |
| 286 | + sort: [].sort, |
| 287 | + splice: [].splice, |
| 288 | + |
| 289 | + find: function( selector ) { |
| 290 | + if ( this.length === 1 ) { |
| 291 | + var ret = this.pushStack( [], "find", selector ); |
| 292 | + ret.length = 0; |
| 293 | + jQuery.find( selector, this[0], ret ); |
| 294 | + return ret; |
| 295 | + } else { |
| 296 | + return this.pushStack( jQuery.unique( jQuery.map( this, function( elem ) { |
| 297 | + return jQuery.find( selector, elem ); |
| 298 | + } ) ), "find", selector ); |
| 299 | + } |
| 300 | + }, |
| 301 | + |
| 302 | + clone : function( events ) { |
| 303 | + // Do the clone |
| 304 | + var ret = this.map( function() { |
| 305 | + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc( this ) ) { |
| 306 | + // IE copies events bound via attachEvent when |
| 307 | + // using cloneNode. Calling detachEvent on the |
| 308 | + // clone will also remove the events from the orignal |
| 309 | + // In order to get around this, we use innerHTML. |
| 310 | + // Unfortunately, this means some modifications to |
| 311 | + // attributes in IE that are actually only stored |
| 312 | + // as properties will not be copied (such as the |
| 313 | + // the name attribute on an input). |
| 314 | + var html = this.outerHTML; |
| 315 | + if ( !html ) { |
| 316 | + var div = this.ownerDocument.createElement( "div" ); |
| 317 | + div.appendChild( this.cloneNode( true ) ); |
| 318 | + html = div.innerHTML; |
| 319 | + } |
| 320 | + |
| 321 | + return jQuery.clean( [ html.replace( / jQuery\d+="(?:\d+|null)"/g, "" ).replace( /^\s*/, "" ) ] )[0]; |
| 322 | + } else |
| 323 | + return this.cloneNode( true ); |
| 324 | + } ); |
| 325 | + |
| 326 | + // Copy the events from the original to the clone |
| 327 | + if ( events === true ) { |
| 328 | + var orig = this.find( "*" ).andSelf(), i = 0; |
| 329 | + |
| 330 | + ret.find( "*" ).andSelf().each( function() { |
| 331 | + if ( this.nodeName !== orig[i].nodeName ) |
| 332 | + return; |
| 333 | + |
| 334 | + var events = jQuery.data( orig[i], "events" ); |
| 335 | + |
| 336 | + for ( var type in events ) { |
| 337 | + for ( var handler in events[ type ] ) { |
| 338 | + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); |
| 339 | + } |
| 340 | + } |
| 341 | + |
| 342 | + i++; |
| 343 | + } ); |
| 344 | + } |
| 345 | + |
| 346 | + // Return the cloned set |
| 347 | + return ret; |
| 348 | + }, |
| 349 | + |
| 350 | + filter: function( selector ) { |
| 351 | + return this.pushStack( |
| 352 | + jQuery.isFunction( selector ) && |
| 353 | + jQuery.grep( this, function( elem, i ) { |
| 354 | + return selector.call( elem, i ); |
| 355 | + } ) || |
| 356 | + |
| 357 | + jQuery.multiFilter( selector, jQuery.grep( this, function( elem ) { |
| 358 | + return elem.nodeType === 1; |
| 359 | + } ) ), "filter", selector ); |
| 360 | + }, |
| 361 | + |
| 362 | + closest: function( selector ) { |
| 363 | + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery( selector ) : null, |
| 364 | + closer = 0; |
| 365 | + |
| 366 | + return this.map( function() { |
| 367 | + var cur = this; |
| 368 | + while ( cur && cur.ownerDocument ) { |
| 369 | + if ( pos ? pos.index( cur ) > - 1 : jQuery( cur ).is( selector ) ) { |
| 370 | + jQuery.data( cur, "closest", closer ); |
| 371 | + return cur; |
| 372 | + } |
| 373 | + cur = cur.parentNode; |
| 374 | + closer++; |
| 375 | + } |
| 376 | + } ); |
| 377 | + }, |
| 378 | + |
| 379 | + not: function( selector ) { |
| 380 | + if ( typeof selector === "string" ) |
| 381 | + // test special case where just one selector is passed in |
| 382 | + if ( isSimple.test( selector ) ) |
| 383 | + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); |
| 384 | + else |
| 385 | + selector = jQuery.multiFilter( selector, this ); |
| 386 | + |
| 387 | + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; |
| 388 | + return this.filter( function() { |
| 389 | + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; |
| 390 | + } ); |
| 391 | + }, |
| 392 | + |
| 393 | + add: function( selector ) { |
| 394 | + return this.pushStack( jQuery.unique( jQuery.merge( |
| 395 | + this.get(), |
| 396 | + typeof selector === "string" ? |
| 397 | + jQuery( selector ) : |
| 398 | + jQuery.makeArray( selector ) |
| 399 | + ) ) ); |
| 400 | + }, |
| 401 | + |
| 402 | + is: function( selector ) { |
| 403 | + return !!selector && jQuery.multiFilter( selector, this ).length > 0; |
| 404 | + }, |
| 405 | + |
| 406 | + hasClass: function( selector ) { |
| 407 | + return !!selector && this.is( "." + selector ); |
| 408 | + }, |
| 409 | + |
| 410 | + val: function( value ) { |
| 411 | + if ( value === undefined ) { |
| 412 | + var elem = this[0]; |
| 413 | + |
| 414 | + if ( elem ) { |
| 415 | + if ( jQuery.nodeName( elem, 'option' ) ) |
| 416 | + return ( elem.attributes.value || { } ).specified ? elem.value : elem.text; |
| 417 | + |
| 418 | + // We need to handle select boxes special |
| 419 | + if ( jQuery.nodeName( elem, "select" ) ) { |
| 420 | + var index = elem.selectedIndex, |
| 421 | + values = [], |
| 422 | + options = elem.options, |
| 423 | + one = elem.type == "select-one"; |
| 424 | + |
| 425 | + // Nothing was selected |
| 426 | + if ( index < 0 ) |
| 427 | + return null; |
| 428 | + |
| 429 | + // Loop through all the selected options |
| 430 | + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { |
| 431 | + var option = options[ i ]; |
| 432 | + |
| 433 | + if ( option.selected ) { |
| 434 | + // Get the specifc value for the option |
| 435 | + value = jQuery( option ).val(); |
| 436 | + |
| 437 | + // We don't need an array for one selects |
| 438 | + if ( one ) |
| 439 | + return value; |
| 440 | + |
| 441 | + // Multi-Selects return an array |
| 442 | + values.push( value ); |
| 443 | + } |
| 444 | + } |
| 445 | + |
| 446 | + return values; |
| 447 | + } |
| 448 | + |
| 449 | + // Everything else, we just grab the value |
| 450 | + return ( elem.value || "" ).replace( /\r/g, "" ); |
| 451 | + |
| 452 | + } |
| 453 | + |
| 454 | + return undefined; |
| 455 | + } |
| 456 | + |
| 457 | + if ( typeof value === "number" ) |
| 458 | + value += ''; |
| 459 | + |
| 460 | + return this.each( function() { |
| 461 | + if ( this.nodeType != 1 ) |
| 462 | + return; |
| 463 | + |
| 464 | + if ( jQuery.isArray( value ) && / radio | checkbox / .test( this.type ) ) |
| 465 | + this.checked = ( jQuery.inArray( this.value, value ) >= 0 || |
| 466 | + jQuery.inArray( this.name, value ) >= 0 ); |
| 467 | + |
| 468 | + else if ( jQuery.nodeName( this, "select" ) ) { |
| 469 | + var values = jQuery.makeArray( value ); |
| 470 | + |
| 471 | + jQuery( "option", this ).each( function() { |
| 472 | + this.selected = ( jQuery.inArray( this.value, values ) >= 0 || |
| 473 | + jQuery.inArray( this.text, values ) >= 0 ); |
| 474 | + } ); |
| 475 | + |
| 476 | + if ( !values.length ) |
| 477 | + this.selectedIndex = - 1; |
| 478 | + |
| 479 | + } else |
| 480 | + this.value = value; |
| 481 | + } ); |
| 482 | + }, |
| 483 | + |
| 484 | + html: function( value ) { |
| 485 | + return value === undefined ? |
| 486 | + ( this[0] ? |
| 487 | + this[0].innerHTML.replace( / jQuery\d+="(?:\d+|null)"/g, "" ) : |
| 488 | + null ) : |
| 489 | + this.empty().append( value ); |
| 490 | + }, |
| 491 | + |
| 492 | + replaceWith: function( value ) { |
| 493 | + return this.after( value ).remove(); |
| 494 | + }, |
| 495 | + |
| 496 | + eq: function( i ) { |
| 497 | + return this.slice( i, + i + 1 ); |
| 498 | + }, |
| 499 | + |
| 500 | + slice: function() { |
| 501 | + return this.pushStack( Array.prototype.slice.apply( this, arguments ), |
| 502 | + "slice", Array.prototype.slice.call( arguments ).join( "," ) ); |
| 503 | + }, |
| 504 | + |
| 505 | + map: function( callback ) { |
| 506 | + return this.pushStack( jQuery.map( this, function( elem, i ) { |
| 507 | + return callback.call( elem, i, elem ); |
| 508 | + } ) ); |
| 509 | + }, |
| 510 | + |
| 511 | + andSelf: function() { |
| 512 | + return this.add( this.prevObject ); |
| 513 | + }, |
| 514 | + |
| 515 | + domManip: function( args, table, callback ) { |
| 516 | + if ( this[0] ) { |
| 517 | + var fragment = ( this[0].ownerDocument || this[0] ).createDocumentFragment(), |
| 518 | + scripts = jQuery.clean( args, ( this[0].ownerDocument || this[0] ), fragment ), |
| 519 | + first = fragment.firstChild; |
| 520 | + |
| 521 | + if ( first ) |
| 522 | + for ( var i = 0, l = this.length; i < l; i++ ) |
| 523 | + callback.call( root( this[i], first ), this.length > 1 || i > 0 ? |
| 524 | + fragment.cloneNode( true ) : fragment ); |
| 525 | + |
| 526 | + if ( scripts ) |
| 527 | + jQuery.each( scripts, evalScript ); |
| 528 | + } |
| 529 | + |
| 530 | + return this; |
| 531 | + |
| 532 | + function root( elem, cur ) { |
| 533 | + return table && jQuery.nodeName( elem, "table" ) && jQuery.nodeName( cur, "tr" ) ? |
| 534 | + ( elem.getElementsByTagName( "tbody" )[0] || |
| 535 | + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) ) : |
| 536 | + elem; |
| 537 | + } |
| 538 | + } |
| 539 | +}; |
| 540 | + |
| 541 | +// Give the init function the jQuery prototype for later instantiation |
| 542 | +jQuery.fn.init.prototype = jQuery.fn; |
| 543 | + |
| 544 | +function evalScript( i, elem ) { |
| 545 | + if ( elem.src ) |
| 546 | + jQuery.ajax( { |
| 547 | + url: elem.src, |
| 548 | + async: false, |
| 549 | + dataType: "script" |
| 550 | + } ); |
| 551 | + |
| 552 | + else |
| 553 | + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); |
| 554 | + |
| 555 | + if ( elem.parentNode ) |
| 556 | + elem.parentNode.removeChild( elem ); |
| 557 | +} |
| 558 | + |
| 559 | +function now() { |
| 560 | + return + new Date; |
| 561 | +} |
| 562 | + |
| 563 | +jQuery.extend = jQuery.fn.extend = function() { |
| 564 | + // copy reference to target object |
| 565 | + var target = arguments[0] || { }, i = 1, length = arguments.length, deep = false, options; |
| 566 | + |
| 567 | + // Handle a deep copy situation |
| 568 | + if ( typeof target === "boolean" ) { |
| 569 | + deep = target; |
| 570 | + target = arguments[1] || { }; |
| 571 | + // skip the boolean and the target |
| 572 | + i = 2; |
| 573 | + } |
| 574 | + |
| 575 | + // Handle case when target is a string or something (possible in deep copy) |
| 576 | + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) |
| 577 | + target = { }; |
| 578 | + |
| 579 | + // extend jQuery itself if only one argument is passed |
| 580 | + if ( length == i ) { |
| 581 | + target = this; |
| 582 | + --i; |
| 583 | + } |
| 584 | + |
| 585 | + for ( ; i < length; i++ ) |
| 586 | + // Only deal with non-null/undefined values |
| 587 | + if ( ( options = arguments[ i ] ) != null ) |
| 588 | + // Extend the base object |
| 589 | + for ( var name in options ) { |
| 590 | + var src = target[ name ], copy = options[ name ]; |
| 591 | + |
| 592 | + // Prevent never-ending loop |
| 593 | + if ( target === copy ) |
| 594 | + continue; |
| 595 | + |
| 596 | + // Recurse if we're merging object values |
| 597 | + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) |
| 598 | + target[ name ] = jQuery.extend( deep, |
| 599 | + // Never move original objects, clone them |
| 600 | + src || ( copy.length != null ? [ ] : { } ) |
| 601 | + , copy ); |
| 602 | + |
| 603 | + // Don't bring in undefined values |
| 604 | + else if ( copy !== undefined ) |
| 605 | + target[ name ] = copy; |
| 606 | + |
| 607 | + } |
| 608 | + |
| 609 | + // Return the modified object |
| 610 | + return target; |
| 611 | +}; |
| 612 | + |
| 613 | +// exclude the following css properties to add px |
| 614 | +var exclude = / z - ? index | font - ? weight | opacity | zoom | line - ? height /i, |
| 615 | + // cache defaultView |
| 616 | + defaultView = document.defaultView || { }, |
| 617 | + toString = Object.prototype.toString; |
| 618 | + |
| 619 | +jQuery.extend( { |
| 620 | + noConflict: function( deep ) { |
| 621 | + window.$ = _$; |
| 622 | + |
| 623 | + if ( deep ) |
| 624 | + window.jQuery = _jQuery; |
| 625 | + |
| 626 | + return jQuery; |
| 627 | + }, |
| 628 | + |
| 629 | + // See test/unit/core.js for details concerning isFunction. |
| 630 | + // Since version 1.3, DOM methods and functions like alert |
| 631 | + // aren't supported. They return false on IE (#2968). |
| 632 | + isFunction: function( obj ) { |
| 633 | + return toString.call( obj ) === "[object Function]"; |
| 634 | + }, |
| 635 | + |
| 636 | + isArray: function( obj ) { |
| 637 | + return toString.call( obj ) === "[object Array]"; |
| 638 | + }, |
| 639 | + |
| 640 | + // check if an element is in a (or is an) XML document |
| 641 | + isXMLDoc: function( elem ) { |
| 642 | + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || |
| 643 | + !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); |
| 644 | + }, |
| 645 | + |
| 646 | + // Evalulates a script in a global context |
| 647 | + globalEval: function( data ) { |
| 648 | + if ( data && /\S/.test( data ) ) { |
| 649 | + // Inspired by code by Andrea Giammarchi |
| 650 | + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html |
| 651 | + var head = document.getElementsByTagName( "head" )[0] || document.documentElement, |
| 652 | + script = document.createElement( "script" ); |
| 653 | + |
| 654 | + script.type = "text/javascript"; |
| 655 | + if ( jQuery.support.scriptEval ) |
| 656 | + script.appendChild( document.createTextNode( data ) ); |
| 657 | + else |
| 658 | + script.text = data; |
| 659 | + |
| 660 | + // Use insertBefore instead of appendChild to circumvent an IE6 bug. |
| 661 | + // This arises when a base node is used (#2709). |
| 662 | + head.insertBefore( script, head.firstChild ); |
| 663 | + head.removeChild( script ); |
| 664 | + } |
| 665 | + }, |
| 666 | + |
| 667 | + nodeName: function( elem, name ) { |
| 668 | + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); |
| 669 | + }, |
| 670 | + |
| 671 | + // args is for internal usage only |
| 672 | + each: function( object, callback, args ) { |
| 673 | + var name, i = 0, length = object.length; |
| 674 | + |
| 675 | + if ( args ) { |
| 676 | + if ( length === undefined ) { |
| 677 | + for ( name in object ) |
| 678 | + if ( callback.apply( object[ name ], args ) === false ) |
| 679 | + break; |
| 680 | + } else |
| 681 | + for ( ; i < length; ) |
| 682 | + if ( callback.apply( object[ i++ ], args ) === false ) |
| 683 | + break; |
| 684 | + |
| 685 | + // A special, fast, case for the most common use of each |
| 686 | + } else { |
| 687 | + if ( length === undefined ) { |
| 688 | + for ( name in object ) |
| 689 | + if ( callback.call( object[ name ], name, object[ name ] ) === false ) |
| 690 | + break; |
| 691 | + } else |
| 692 | + for ( var value = object[0]; |
| 693 | + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) { } |
| 694 | + } |
| 695 | + |
| 696 | + return object; |
| 697 | + }, |
| 698 | + |
| 699 | + prop: function( elem, value, type, i, name ) { |
| 700 | + // Handle executable functions |
| 701 | + if ( jQuery.isFunction( value ) ) |
| 702 | + value = value.call( elem, i ); |
| 703 | + |
| 704 | + // Handle passing in a number to a CSS property |
| 705 | + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? |
| 706 | + value + "px" : |
| 707 | + value; |
| 708 | + }, |
| 709 | + |
| 710 | + className: { |
| 711 | + // internal only, use addClass("class") |
| 712 | + add: function( elem, classNames ) { |
| 713 | + jQuery.each( ( classNames || "" ).split( /\s+/ ), function( i, className ) { |
| 714 | + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) |
| 715 | + elem.className += ( elem.className ? " " : "" ) + className; |
| 716 | + } ); |
| 717 | + }, |
| 718 | + |
| 719 | + // internal only, use removeClass("class") |
| 720 | + remove: function( elem, classNames ) { |
| 721 | + if ( elem.nodeType == 1 ) |
| 722 | + elem.className = classNames !== undefined ? |
| 723 | + jQuery.grep( elem.className.split( /\s+/ ), function( className ) { |
| 724 | + return !jQuery.className.has( classNames, className ); |
| 725 | + } ).join( " " ) : |
| 726 | + ""; |
| 727 | + }, |
| 728 | + |
| 729 | + // internal only, use hasClass("class") |
| 730 | + has: function( elem, className ) { |
| 731 | + return elem && jQuery.inArray( className, ( elem.className || elem ).toString().split( /\s+/ ) ) > -1; |
| 732 | + } |
| 733 | + }, |
| 734 | + |
| 735 | + // A method for quickly swapping in/out CSS properties to get correct calculations |
| 736 | + swap: function( elem, options, callback ) { |
| 737 | + var old = { }; |
| 738 | + // Remember the old values, and insert the new ones |
| 739 | + for ( var name in options ) { |
| 740 | + old[ name ] = elem.style[ name ]; |
| 741 | + elem.style[ name ] = options[ name ]; |
| 742 | + } |
| 743 | + |
| 744 | + callback.call( elem ); |
| 745 | + |
| 746 | + // Revert the old values |
| 747 | + for ( var name in options ) |
| 748 | + elem.style[ name ] = old[ name ]; |
| 749 | + }, |
| 750 | + |
| 751 | + css: function( elem, name, force, extra ) { |
| 752 | + if ( name == "width" || name == "height" ) { |
| 753 | + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; |
| 754 | + |
| 755 | + function getWH() { |
| 756 | + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; |
| 757 | + |
| 758 | + if ( extra === "border" ) |
| 759 | + return; |
| 760 | + |
| 761 | + jQuery.each( which, function() { |
| 762 | + if ( !extra ) |
| 763 | + val -= parseFloat( jQuery.curCSS( elem, "padding" + this, true ) ) || 0; |
| 764 | + if ( extra === "margin" ) |
| 765 | + val += parseFloat( jQuery.curCSS( elem, "margin" + this, true ) ) || 0; |
| 766 | + else |
| 767 | + val -= parseFloat( jQuery.curCSS( elem, "border" + this + "Width", true ) ) || 0; |
| 768 | + } ); |
| 769 | + } |
| 770 | + |
| 771 | + if ( elem.offsetWidth !== 0 ) |
| 772 | + getWH(); |
| 773 | + else |
| 774 | + jQuery.swap( elem, props, getWH ); |
| 775 | + |
| 776 | + return Math.max( 0, Math.round( val ) ); |
| 777 | + } |
| 778 | + |
| 779 | + return jQuery.curCSS( elem, name, force ); |
| 780 | + }, |
| 781 | + |
| 782 | + curCSS: function( elem, name, force ) { |
| 783 | + var ret, style = elem.style; |
| 784 | + |
| 785 | + // We need to handle opacity special in IE |
| 786 | + if ( name == "opacity" && !jQuery.support.opacity ) { |
| 787 | + ret = jQuery.attr( style, "opacity" ); |
| 788 | + |
| 789 | + return ret == "" ? |
| 790 | + "1" : |
| 791 | + ret; |
| 792 | + } |
| 793 | + |
| 794 | + // Make sure we're using the right name for getting the float value |
| 795 | + if ( name.match( / float /i ) ) |
| 796 | + name = styleFloat; |
| 797 | + |
| 798 | + if ( !force && style && style[ name ] ) |
| 799 | + ret = style[ name ]; |
| 800 | + |
| 801 | + else if ( defaultView.getComputedStyle ) { |
| 802 | + |
| 803 | + // Only "float" is needed here |
| 804 | + if ( name.match( / float /i ) ) |
| 805 | + name = "float"; |
| 806 | + |
| 807 | + name = name.replace( / ( [A - Z] ) /g, "-$1" ).toLowerCase(); |
| 808 | + |
| 809 | + var computedStyle = defaultView.getComputedStyle( elem, null ); |
| 810 | + |
| 811 | + if ( computedStyle ) |
| 812 | + ret = computedStyle.getPropertyValue( name ); |
| 813 | + |
| 814 | + // We should always get a number back from opacity |
| 815 | + if ( name == "opacity" && ret == "" ) |
| 816 | + ret = "1"; |
| 817 | + |
| 818 | + } else if ( elem.currentStyle ) { |
| 819 | + var camelCase = name.replace( /\-(\w)/g, function( all, letter ) { |
| 820 | + return letter.toUpperCase(); |
| 821 | + } ); |
| 822 | + |
| 823 | + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; |
| 824 | + |
| 825 | + // From the awesome hack by Dean Edwards |
| 826 | + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
| 827 | + |
| 828 | + // If we're not dealing with a regular pixel number |
| 829 | + // but a number that has a weird ending, we need to convert it to pixels |
| 830 | + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { |
| 831 | + // Remember the original values |
| 832 | + var left = style.left, rsLeft = elem.runtimeStyle.left; |
| 833 | + |
| 834 | + // Put in the new values to get a computed value out |
| 835 | + elem.runtimeStyle.left = elem.currentStyle.left; |
| 836 | + style.left = ret || 0; |
| 837 | + ret = style.pixelLeft + "px"; |
| 838 | + |
| 839 | + // Revert the changed values |
| 840 | + style.left = left; |
| 841 | + elem.runtimeStyle.left = rsLeft; |
| 842 | + } |
| 843 | + } |
| 844 | + |
| 845 | + return ret; |
| 846 | + }, |
| 847 | + |
| 848 | + clean: function( elems, context, fragment ) { |
| 849 | + context = context || document; |
| 850 | + |
| 851 | + // !context.createElement fails in IE with an error but returns typeof 'object' |
| 852 | + if ( typeof context.createElement === "undefined" ) |
| 853 | + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; |
| 854 | + |
| 855 | + // If a single string is passed in and it's a single tag |
| 856 | + // just do a createElement and skip the rest |
| 857 | + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { |
| 858 | + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); |
| 859 | + if ( match ) |
| 860 | + return [ context.createElement( match[1] ) ]; |
| 861 | + } |
| 862 | + |
| 863 | + var ret = [], scripts = [], div = context.createElement("div"); |
| 864 | + |
| 865 | + jQuery.each(elems, function(i, elem){ |
| 866 | + if ( typeof elem === "number" ) |
| 867 | + elem += ''; |
| 868 | + |
| 869 | + if ( !elem ) |
| 870 | + return; |
| 871 | + |
| 872 | + // Convert html string into DOM nodes |
| 873 | + if ( typeof elem === "string" ) { |
| 874 | + // Fix "XHTML"-style tags in all browsers |
| 875 | + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ |
| 876 | + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? |
| 877 | + all : |
| 878 | + front + "></" + tag + ">"; |
| 879 | + }); |
| 880 | + |
| 881 | + // Trim whitespace, otherwise indexOf won't work as expected |
| 882 | + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); |
| 883 | + |
| 884 | + var wrap = |
| 885 | + // option or optgroup |
| 886 | + !tags.indexOf("<opt") && |
| 887 | + [ 1, "<select multiple='multiple'>", "</select>" ] || |
| 888 | + |
| 889 | + !tags.indexOf("<leg") && |
| 890 | + [ 1, "<fieldset>", "</fieldset>" ] || |
| 891 | + |
| 892 | + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && |
| 893 | + [ 1, "<table>", "</table>" ] || |
| 894 | + |
| 895 | + !tags.indexOf("<tr") && |
| 896 | + [ 2, "<table><tbody>", "</tbody></table>" ] || |
| 897 | + |
| 898 | + // <thead> matched above |
| 899 | + (!tags.indexOf("<td") || !tags.indexOf("<th")) && |
| 900 | + [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || |
| 901 | + |
| 902 | + !tags.indexOf("<col") && |
| 903 | + [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || |
| 904 | + |
| 905 | + // IE can't serialize <link> and <script> tags normally |
| 906 | + !jQuery.support.htmlSerialize && |
| 907 | + [ 1, "div<div>", "</div>" ] || |
| 908 | + |
| 909 | + [ 0, "", "" ]; |
| 910 | + |
| 911 | + // Go to html and back, then peel off extra wrappers |
| 912 | + div.innerHTML = wrap[1] + elem + wrap[2]; |
| 913 | + |
| 914 | + // Move to the right depth |
| 915 | + while ( wrap[0]-- ) |
| 916 | + div = div.lastChild; |
| 917 | + |
| 918 | + // Remove IE's autoinserted <tbody> from table fragments |
| 919 | + if ( !jQuery.support.tbody ) { |
| 920 | + |
| 921 | + // String was a <table>, *may* have spurious <tbody> |
| 922 | + var hasBody = /<tbody/i.test(elem), |
| 923 | + tbody = !tags.indexOf("<table") && !hasBody ? |
| 924 | + div.firstChild && div.firstChild.childNodes : |
| 925 | + |
| 926 | + // String was a bare <thead> or <tfoot> |
| 927 | + wrap[1] == "<table>" && !hasBody ? |
| 928 | + div.childNodes : |
| 929 | + []; |
| 930 | + |
| 931 | + for ( var j = tbody.length - 1; j >= 0 ; --j ) |
| 932 | + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) |
| 933 | + tbody[ j ].parentNode.removeChild( tbody[ j ] ); |
| 934 | + |
| 935 | + } |
| 936 | + |
| 937 | + // IE completely kills leading whitespace when innerHTML is used |
| 938 | + if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) |
| 939 | + div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); |
| 940 | + |
| 941 | + elem = jQuery.makeArray( div.childNodes ); |
| 942 | + } |
| 943 | + |
| 944 | + if ( elem.nodeType ) |
| 945 | + ret.push( elem ); |
| 946 | + else |
| 947 | + ret = jQuery.merge( ret, elem ); |
| 948 | + |
| 949 | + }); |
| 950 | + |
| 951 | + if ( fragment ) { |
| 952 | + for ( var i = 0; ret[i]; i++ ) { |
| 953 | + if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { |
| 954 | + scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); |
| 955 | + } else { |
| 956 | + if ( ret[i].nodeType === 1 ) |
| 957 | + ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); |
| 958 | + fragment.appendChild( ret[i] ); |
| 959 | + } |
| 960 | + } |
| 961 | + |
| 962 | + return scripts; |
| 963 | + } |
| 964 | + |
| 965 | + return ret; |
| 966 | + }, |
| 967 | + |
| 968 | + attr: function( elem, name, value ) { |
| 969 | + // don't set attributes on text and comment nodes |
| 970 | + if (!elem || elem.nodeType == 3 || elem.nodeType == 8) |
| 971 | + return undefined; |
| 972 | + |
| 973 | + var notxml = !jQuery.isXMLDoc( elem ), |
| 974 | + // Whether we are setting (or getting) |
| 975 | + set = value !== undefined; |
| 976 | + |
| 977 | + // Try to normalize/fix the name |
| 978 | + name = notxml && jQuery.props[ name ] || name; |
| 979 | + |
| 980 | + // Only do all the following if this is a node (faster for style) |
| 981 | + // IE elem.getAttribute passes even for style |
| 982 | + if ( elem.tagName ) { |
| 983 | + |
| 984 | + // These attributes require special treatment |
| 985 | + var special = /href|src|style/.test( name ); |
| 986 | + |
| 987 | + // Safari mis-reports the default selected property of a hidden option |
| 988 | + // Accessing the parent's selectedIndex property fixes it |
| 989 | + if ( name == "selected" && elem.parentNode ) |
| 990 | + elem.parentNode.selectedIndex; |
| 991 | + |
| 992 | + // If applicable, access the attribute via the DOM 0 way |
| 993 | + if ( name in elem && notxml && !special ) { |
| 994 | + if ( set ){ |
| 995 | + // We can't allow the type property to be changed (since it causes problems in IE) |
| 996 | + if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) |
| 997 | + throw "type property can't be changed"; |
| 998 | + |
| 999 | + elem[ name ] = value; |
| 1000 | + } |
| 1001 | + |
| 1002 | + // browsers index elements by id/name on forms, give priority to attributes. |
| 1003 | + if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) |
| 1004 | + return elem.getAttributeNode( name ).nodeValue; |
| 1005 | + |
| 1006 | + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set |
| 1007 | + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
| 1008 | + if ( name == "tabIndex" ) { |
| 1009 | + var attributeNode = elem.getAttributeNode( "tabIndex" ); |
| 1010 | + return attributeNode && attributeNode.specified |
| 1011 | + ? attributeNode.value |
| 1012 | + : elem.nodeName.match(/(button|input|object|select|textarea)/i) |
| 1013 | + ? 0 |
| 1014 | + : elem.nodeName.match(/^(a|area)$/i) && elem.href |
| 1015 | + ? 0 |
| 1016 | + : undefined; |
| 1017 | + } |
| 1018 | + |
| 1019 | + return elem[ name ]; |
| 1020 | + } |
| 1021 | + |
| 1022 | + if ( !jQuery.support.style && notxml && name == "style" ) |
| 1023 | + return jQuery.attr( elem.style, "cssText", value ); |
| 1024 | + |
| 1025 | + if ( set ) |
| 1026 | + // convert the value to a string (all browsers do this but IE) see #1070 |
| 1027 | + elem.setAttribute( name, "" + value ); |
| 1028 | + |
| 1029 | + var attr = !jQuery.support.hrefNormalized && notxml && special |
| 1030 | + // Some attributes require a special call on IE |
| 1031 | + ? elem.getAttribute( name, 2 ) |
| 1032 | + : elem.getAttribute( name ); |
| 1033 | + |
| 1034 | + // Non-existent attributes return null, we normalize to undefined |
| 1035 | + return attr === null ? undefined : attr; |
| 1036 | + } |
| 1037 | + |
| 1038 | + // elem is actually elem.style ... set the style |
| 1039 | + |
| 1040 | + // IE uses filters for opacity |
| 1041 | + if ( !jQuery.support.opacity && name == "opacity" ) { |
| 1042 | + if ( set ) { |
| 1043 | + // IE has trouble with opacity if it does not have layout |
| 1044 | + // Force it by setting the zoom level |
| 1045 | + elem.zoom = 1; |
| 1046 | + |
| 1047 | + // Set the alpha filter to set the opacity |
| 1048 | + elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + |
| 1049 | + (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); |
| 1050 | + } |
| 1051 | + |
| 1052 | + return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? |
| 1053 | + (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': |
| 1054 | + ""; |
| 1055 | + } |
| 1056 | + |
| 1057 | + name = name.replace(/-([a-z])/ig, function(all, letter){ |
| 1058 | + return letter.toUpperCase(); |
| 1059 | + }); |
| 1060 | + |
| 1061 | + if ( set ) |
| 1062 | + elem[ name ] = value; |
| 1063 | + |
| 1064 | + return elem[ name ]; |
| 1065 | + }, |
| 1066 | + |
| 1067 | + trim: function( text ) { |
| 1068 | + return (text || "").replace( /^\s+|\s+$/g, "" ); |
| 1069 | + }, |
| 1070 | + |
| 1071 | + makeArray: function( array ) { |
| 1072 | + var ret = []; |
| 1073 | + |
| 1074 | + if( array != null ){ |
| 1075 | + var i = array.length; |
| 1076 | + // The window, strings (and functions) also have 'length' |
| 1077 | + if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) |
| 1078 | + ret[0] = array; |
| 1079 | + else |
| 1080 | + while( i ) |
| 1081 | + ret[--i] = array[i]; |
| 1082 | + } |
| 1083 | + |
| 1084 | + return ret; |
| 1085 | + }, |
| 1086 | + |
| 1087 | + inArray: function( elem, array ) { |
| 1088 | + for ( var i = 0, length = array.length; i < length; i++ ) |
| 1089 | + // Use === because on IE, window == document |
| 1090 | + if ( array[ i ] === elem ) |
| 1091 | + return i; |
| 1092 | + |
| 1093 | + return -1; |
| 1094 | + }, |
| 1095 | + |
| 1096 | + merge: function( first, second ) { |
| 1097 | + // We have to loop this way because IE & Opera overwrite the length |
| 1098 | + // expando of getElementsByTagName |
| 1099 | + var i = 0, elem, pos = first.length; |
| 1100 | + // Also, we need to make sure that the correct elements are being returned |
| 1101 | + // (IE returns comment nodes in a '*' query) |
| 1102 | + if ( !jQuery.support.getAll ) { |
| 1103 | + while ( (elem = second[ i++ ]) != null ) |
| 1104 | + if ( elem.nodeType != 8 ) |
| 1105 | + first[ pos++ ] = elem; |
| 1106 | + |
| 1107 | + } else |
| 1108 | + while ( (elem = second[ i++ ]) != null ) |
| 1109 | + first[ pos++ ] = elem; |
| 1110 | + |
| 1111 | + return first; |
| 1112 | + }, |
| 1113 | + |
| 1114 | + unique: function( array ) { |
| 1115 | + var ret = [], done = {}; |
| 1116 | + |
| 1117 | + try { |
| 1118 | + |
| 1119 | + for ( var i = 0, length = array.length; i < length; i++ ) { |
| 1120 | + var id = jQuery.data( array[ i ] ); |
| 1121 | + |
| 1122 | + if ( !done[ id ] ) { |
| 1123 | + done[ id ] = true; |
| 1124 | + ret.push( array[ i ] ); |
| 1125 | + } |
| 1126 | + } |
| 1127 | + |
| 1128 | + } catch( e ) { |
| 1129 | + ret = array; |
| 1130 | + } |
| 1131 | + |
| 1132 | + return ret; |
| 1133 | + }, |
| 1134 | + |
| 1135 | + grep: function( elems, callback, inv ) { |
| 1136 | + var ret = []; |
| 1137 | + |
| 1138 | + // Go through the array, only saving the items |
| 1139 | + // that pass the validator function |
| 1140 | + for ( var i = 0, length = elems.length; i < length; i++ ) |
| 1141 | + if ( !inv != !callback( elems[ i ], i ) ) |
| 1142 | + ret.push( elems[ i ] ); |
| 1143 | + |
| 1144 | + return ret; |
| 1145 | + }, |
| 1146 | + |
| 1147 | + map: function( elems, callback ) { |
| 1148 | + var ret = []; |
| 1149 | + |
| 1150 | + // Go through the array, translating each of the items to their |
| 1151 | + // new value (or values). |
| 1152 | + for ( var i = 0, length = elems.length; i < length; i++ ) { |
| 1153 | + var value = callback( elems[ i ], i ); |
| 1154 | + |
| 1155 | + if ( value != null ) |
| 1156 | + ret[ ret.length ] = value; |
| 1157 | + } |
| 1158 | + |
| 1159 | + return ret.concat.apply( [], ret ); |
| 1160 | + } |
| 1161 | +}); |
| 1162 | + |
| 1163 | +// Use of jQuery.browser is deprecated. |
| 1164 | +// It's included for backwards compatibility and plugins, |
| 1165 | +// although they should work to migrate away. |
| 1166 | + |
| 1167 | +var userAgent = navigator.userAgent.toLowerCase(); |
| 1168 | + |
| 1169 | +// Figure out what browser is being used |
| 1170 | +jQuery.browser = { |
| 1171 | + version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], |
| 1172 | + safari: /webkit/.test( userAgent ), |
| 1173 | + opera: /opera/.test( userAgent ), |
| 1174 | + msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), |
| 1175 | + mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) |
| 1176 | +}; |
| 1177 | + |
| 1178 | +jQuery.each({ |
| 1179 | + parent: function(elem){return elem.parentNode;}, |
| 1180 | + parents: function(elem){return jQuery.dir(elem,"parentNode");}, |
| 1181 | + next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, |
| 1182 | + prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, |
| 1183 | + nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, |
| 1184 | + prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, |
| 1185 | + siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, |
| 1186 | + children: function(elem){return jQuery.sibling(elem.firstChild);}, |
| 1187 | + contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} |
| 1188 | +}, function(name, fn){ |
| 1189 | + jQuery.fn[ name ] = function( selector ) { |
| 1190 | + var ret = jQuery.map( this, fn ); |
| 1191 | + |
| 1192 | + if ( selector && typeof selector == "string" ) |
| 1193 | + ret = jQuery.multiFilter( selector, ret ); |
| 1194 | + |
| 1195 | + return this.pushStack( jQuery.unique( ret ), name, selector ); |
| 1196 | + }; |
| 1197 | +}); |
| 1198 | + |
| 1199 | +jQuery.each({ |
| 1200 | + appendTo: "append", |
| 1201 | + prependTo: "prepend", |
| 1202 | + insertBefore: "before", |
| 1203 | + insertAfter: "after", |
| 1204 | + replaceAll: "replaceWith" |
| 1205 | +}, function(name, original){ |
| 1206 | + jQuery.fn[ name ] = function( selector ) { |
| 1207 | + var ret = [], insert = jQuery( selector ); |
| 1208 | + |
| 1209 | + for ( var i = 0, l = insert.length; i < l; i++ ) { |
| 1210 | + var elems = (i > 0 ? this.clone(true) : this).get(); |
| 1211 | + jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); |
| 1212 | + ret = ret.concat( elems ); |
| 1213 | + } |
| 1214 | + |
| 1215 | + return this.pushStack( ret, name, selector ); |
| 1216 | + }; |
| 1217 | +}); |
| 1218 | + |
| 1219 | +jQuery.each({ |
| 1220 | + removeAttr: function( name ) { |
| 1221 | + jQuery.attr( this, name, "" ); |
| 1222 | + if (this.nodeType == 1) |
| 1223 | + this.removeAttribute( name ); |
| 1224 | + }, |
| 1225 | + |
| 1226 | + addClass: function( classNames ) { |
| 1227 | + jQuery.className.add( this, classNames ); |
| 1228 | + }, |
| 1229 | + |
| 1230 | + removeClass: function( classNames ) { |
| 1231 | + jQuery.className.remove( this, classNames ); |
| 1232 | + }, |
| 1233 | + |
| 1234 | + toggleClass: function( classNames, state ) { |
| 1235 | + if( typeof state !== "boolean" ) |
| 1236 | + state = !jQuery.className.has( this, classNames ); |
| 1237 | + jQuery.className[ state ? "add" : "remove" ]( this, classNames ); |
| 1238 | + }, |
| 1239 | + |
| 1240 | + remove: function( selector ) { |
| 1241 | + if ( !selector || jQuery.filter( selector, [ this ] ).length ) { |
| 1242 | + // Prevent memory leaks |
| 1243 | + jQuery( "*", this ).add([this]).each(function(){ |
| 1244 | + jQuery.event.remove(this); |
| 1245 | + jQuery.removeData(this); |
| 1246 | + }); |
| 1247 | + if (this.parentNode) |
| 1248 | + this.parentNode.removeChild( this ); |
| 1249 | + } |
| 1250 | + }, |
| 1251 | + |
| 1252 | + empty: function() { |
| 1253 | + // Remove element nodes and prevent memory leaks |
| 1254 | + jQuery(this).children().remove(); |
| 1255 | + |
| 1256 | + // Remove any remaining nodes |
| 1257 | + while ( this.firstChild ) |
| 1258 | + this.removeChild( this.firstChild ); |
| 1259 | + } |
| 1260 | +}, function(name, fn){ |
| 1261 | + jQuery.fn[ name ] = function(){ |
| 1262 | + return this.each( fn, arguments ); |
| 1263 | + }; |
| 1264 | +}); |
| 1265 | + |
| 1266 | +// Helper function used by the dimensions and offset modules |
| 1267 | +function num(elem, prop) { |
| 1268 | + return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; |
| 1269 | +} |
| 1270 | +var expando = "jQuery" + now(), uuid = 0, windowData = {}; |
| 1271 | + |
| 1272 | +jQuery.extend({ |
| 1273 | + cache: {}, |
| 1274 | + |
| 1275 | + data: function( elem, name, data ) { |
| 1276 | + elem = elem == window ? |
| 1277 | + windowData : |
| 1278 | + elem; |
| 1279 | + |
| 1280 | + var id = elem[ expando ]; |
| 1281 | + |
| 1282 | + // Compute a unique ID for the element |
| 1283 | + if ( !id ) |
| 1284 | + id = elem[ expando ] = ++uuid; |
| 1285 | + |
| 1286 | + // Only generate the data cache if we're |
| 1287 | + // trying to access or manipulate it |
| 1288 | + if ( name && !jQuery.cache[ id ] ) |
| 1289 | + jQuery.cache[ id ] = {}; |
| 1290 | + |
| 1291 | + // Prevent overriding the named cache with undefined values |
| 1292 | + if ( data !== undefined ) |
| 1293 | + jQuery.cache[ id ][ name ] = data; |
| 1294 | + |
| 1295 | + // Return the named cache data, or the ID for the element |
| 1296 | + return name ? |
| 1297 | + jQuery.cache[ id ][ name ] : |
| 1298 | + id; |
| 1299 | + }, |
| 1300 | + |
| 1301 | + removeData: function( elem, name ) { |
| 1302 | + elem = elem == window ? |
| 1303 | + windowData : |
| 1304 | + elem; |
| 1305 | + |
| 1306 | + var id = elem[ expando ]; |
| 1307 | + |
| 1308 | + // If we want to remove a specific section of the element's data |
| 1309 | + if ( name ) { |
| 1310 | + if ( jQuery.cache[ id ] ) { |
| 1311 | + // Remove the section of cache data |
| 1312 | + delete jQuery.cache[ id ][ name ]; |
| 1313 | + |
| 1314 | + // If we've removed all the data, remove the element's cache |
| 1315 | + name = ""; |
| 1316 | + |
| 1317 | + for ( name in jQuery.cache[ id ] ) |
| 1318 | + break; |
| 1319 | + |
| 1320 | + if ( !name ) |
| 1321 | + jQuery.removeData( elem ); |
| 1322 | + } |
| 1323 | + |
| 1324 | + // Otherwise, we want to remove all of the element's data |
| 1325 | + } else { |
| 1326 | + // Clean up the element expando |
| 1327 | + try { |
| 1328 | + delete elem[ expando ]; |
| 1329 | + } catch(e){ |
| 1330 | + // IE has trouble directly removing the expando |
| 1331 | + // but it's ok with using removeAttribute |
| 1332 | + if ( elem.removeAttribute ) |
| 1333 | + elem.removeAttribute( expando ); |
| 1334 | + } |
| 1335 | + |
| 1336 | + // Completely remove the data cache |
| 1337 | + delete jQuery.cache[ id ]; |
| 1338 | + } |
| 1339 | + }, |
| 1340 | + queue: function( elem, type, data ) { |
| 1341 | + if ( elem ){ |
| 1342 | + |
| 1343 | + type = (type || "fx") + "queue"; |
| 1344 | + |
| 1345 | + var q = jQuery.data( elem, type ); |
| 1346 | + |
| 1347 | + if ( !q || jQuery.isArray(data) ) |
| 1348 | + q = jQuery.data( elem, type, jQuery.makeArray(data) ); |
| 1349 | + else if( data ) |
| 1350 | + q.push( data ); |
| 1351 | + |
| 1352 | + } |
| 1353 | + return q; |
| 1354 | + }, |
| 1355 | + |
| 1356 | + dequeue: function( elem, type ){ |
| 1357 | + var queue = jQuery.queue( elem, type ), |
| 1358 | + fn = queue.shift(); |
| 1359 | + |
| 1360 | + if( !type || type === "fx" ) |
| 1361 | + fn = queue[0]; |
| 1362 | + |
| 1363 | + if( fn !== undefined ) |
| 1364 | + fn.call(elem); |
| 1365 | + } |
| 1366 | +}); |
| 1367 | + |
| 1368 | +jQuery.fn.extend({ |
| 1369 | + data: function( key, value ){ |
| 1370 | + var parts = key.split("."); |
| 1371 | + parts[1] = parts[1] ? "." + parts[1] : ""; |
| 1372 | + |
| 1373 | + if ( value === undefined ) { |
| 1374 | + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); |
| 1375 | + |
| 1376 | + if ( data === undefined && this.length ) |
| 1377 | + data = jQuery.data( this[0], key ); |
| 1378 | + |
| 1379 | + return data === undefined && parts[1] ? |
| 1380 | + this.data( parts[0] ) : |
| 1381 | + data; |
| 1382 | + } else |
| 1383 | + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ |
| 1384 | + jQuery.data( this, key, value ); |
| 1385 | + }); |
| 1386 | + }, |
| 1387 | + |
| 1388 | + removeData: function( key ){ |
| 1389 | + return this.each(function(){ |
| 1390 | + jQuery.removeData( this, key ); |
| 1391 | + }); |
| 1392 | + }, |
| 1393 | + queue: function(type, data){ |
| 1394 | + if ( typeof type !== "string" ) { |
| 1395 | + data = type; |
| 1396 | + type = "fx"; |
| 1397 | + } |
| 1398 | + |
| 1399 | + if ( data === undefined ) |
| 1400 | + return jQuery.queue( this[0], type ); |
| 1401 | + |
| 1402 | + return this.each(function(){ |
| 1403 | + var queue = jQuery.queue( this, type, data ); |
| 1404 | + |
| 1405 | + if( type == "fx" && queue.length == 1 ) |
| 1406 | + queue[0].call(this); |
| 1407 | + }); |
| 1408 | + }, |
| 1409 | + dequeue: function(type){ |
| 1410 | + return this.each(function(){ |
| 1411 | + jQuery.dequeue( this, type ); |
| 1412 | + }); |
| 1413 | + } |
| 1414 | +});/*! |
| 1415 | + * Sizzle CSS Selector Engine - v0.9.3 |
| 1416 | + * Copyright 2009, The Dojo Foundation |
| 1417 | + * Released under the MIT, BSD, and GPL Licenses. |
| 1418 | + * More information: http://sizzlejs.com/ |
| 1419 | + */ |
| 1420 | +(function(){ |
| 1421 | + |
| 1422 | +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, |
| 1423 | + done = 0, |
| 1424 | + toString = Object.prototype.toString; |
| 1425 | + |
| 1426 | +var Sizzle = function(selector, context, results, seed) { |
| 1427 | + results = results || []; |
| 1428 | + context = context || document; |
| 1429 | + |
| 1430 | + if ( context.nodeType !== 1 && context.nodeType !== 9 ) |
| 1431 | + return []; |
| 1432 | + |
| 1433 | + if ( !selector || typeof selector !== "string" ) { |
| 1434 | + return results; |
| 1435 | + } |
| 1436 | + |
| 1437 | + var parts = [], m, set, checkSet, check, mode, extra, prune = true; |
| 1438 | + |
| 1439 | + // Reset the position of the chunker regexp (start from head) |
| 1440 | + chunker.lastIndex = 0; |
| 1441 | + |
| 1442 | + while ( (m = chunker.exec(selector)) !== null ) { |
| 1443 | + parts.push( m[1] ); |
| 1444 | + |
| 1445 | + if ( m[2] ) { |
| 1446 | + extra = RegExp.rightContext; |
| 1447 | + break; |
| 1448 | + } |
| 1449 | + } |
| 1450 | + |
| 1451 | + if ( parts.length > 1 && origPOS.exec( selector ) ) { |
| 1452 | + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { |
| 1453 | + set = posProcess( parts[0] + parts[1], context ); |
| 1454 | + } else { |
| 1455 | + set = Expr.relative[ parts[0] ] ? |
| 1456 | + [ context ] : |
| 1457 | + Sizzle( parts.shift(), context ); |
| 1458 | + |
| 1459 | + while ( parts.length ) { |
| 1460 | + selector = parts.shift(); |
| 1461 | + |
| 1462 | + if ( Expr.relative[ selector ] ) |
| 1463 | + selector += parts.shift(); |
| 1464 | + |
| 1465 | + set = posProcess( selector, set ); |
| 1466 | + } |
| 1467 | + } |
| 1468 | + } else { |
| 1469 | + var ret = seed ? |
| 1470 | + { expr: parts.pop(), set: makeArray(seed) } : |
| 1471 | + Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) ); |
| 1472 | + set = Sizzle.filter( ret.expr, ret.set ); |
| 1473 | + |
| 1474 | + if ( parts.length > 0 ) { |
| 1475 | + checkSet = makeArray(set); |
| 1476 | + } else { |
| 1477 | + prune = false; |
| 1478 | + } |
| 1479 | + |
| 1480 | + while ( parts.length ) { |
| 1481 | + var cur = parts.pop(), pop = cur; |
| 1482 | + |
| 1483 | + if ( !Expr.relative[ cur ] ) { |
| 1484 | + cur = ""; |
| 1485 | + } else { |
| 1486 | + pop = parts.pop(); |
| 1487 | + } |
| 1488 | + |
| 1489 | + if ( pop == null ) { |
| 1490 | + pop = context; |
| 1491 | + } |
| 1492 | + |
| 1493 | + Expr.relative[ cur ]( checkSet, pop, isXML(context) ); |
| 1494 | + } |
| 1495 | + } |
| 1496 | + |
| 1497 | + if ( !checkSet ) { |
| 1498 | + checkSet = set; |
| 1499 | + } |
| 1500 | + |
| 1501 | + if ( !checkSet ) { |
| 1502 | + throw "Syntax error, unrecognized expression: " + (cur || selector); |
| 1503 | + } |
| 1504 | + |
| 1505 | + if ( toString.call(checkSet) === "[object Array]" ) { |
| 1506 | + if ( !prune ) { |
| 1507 | + results.push.apply( results, checkSet ); |
| 1508 | + } else if ( context.nodeType === 1 ) { |
| 1509 | + for ( var i = 0; checkSet[i] != null; i++ ) { |
| 1510 | + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { |
| 1511 | + results.push( set[i] ); |
| 1512 | + } |
| 1513 | + } |
| 1514 | + } else { |
| 1515 | + for ( var i = 0; checkSet[i] != null; i++ ) { |
| 1516 | + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { |
| 1517 | + results.push( set[i] ); |
| 1518 | + } |
| 1519 | + } |
| 1520 | + } |
| 1521 | + } else { |
| 1522 | + makeArray( checkSet, results ); |
| 1523 | + } |
| 1524 | + |
| 1525 | + if ( extra ) { |
| 1526 | + Sizzle( extra, context, results, seed ); |
| 1527 | + |
| 1528 | + if ( sortOrder ) { |
| 1529 | + hasDuplicate = false; |
| 1530 | + results.sort(sortOrder); |
| 1531 | + |
| 1532 | + if ( hasDuplicate ) { |
| 1533 | + for ( var i = 1; i < results.length; i++ ) { |
| 1534 | + if ( results[i] === results[i-1] ) { |
| 1535 | + results.splice(i--, 1); |
| 1536 | + } |
| 1537 | + } |
| 1538 | + } |
| 1539 | + } |
| 1540 | + } |
| 1541 | + |
| 1542 | + return results; |
| 1543 | +}; |
| 1544 | + |
| 1545 | +Sizzle.matches = function(expr, set){ |
| 1546 | + return Sizzle(expr, null, null, set); |
| 1547 | +}; |
| 1548 | + |
| 1549 | +Sizzle.find = function(expr, context, isXML){ |
| 1550 | + var set, match; |
| 1551 | + |
| 1552 | + if ( !expr ) { |
| 1553 | + return []; |
| 1554 | + } |
| 1555 | + |
| 1556 | + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { |
| 1557 | + var type = Expr.order[i], match; |
| 1558 | + |
| 1559 | + if ( (match = Expr.match[ type ].exec( expr )) ) { |
| 1560 | + var left = RegExp.leftContext; |
| 1561 | + |
| 1562 | + if ( left.substr( left.length - 1 ) !== "\\" ) { |
| 1563 | + match[1] = (match[1] || "").replace(/\\/g, ""); |
| 1564 | + set = Expr.find[ type ]( match, context, isXML ); |
| 1565 | + if ( set != null ) { |
| 1566 | + expr = expr.replace( Expr.match[ type ], "" ); |
| 1567 | + break; |
| 1568 | + } |
| 1569 | + } |
| 1570 | + } |
| 1571 | + } |
| 1572 | + |
| 1573 | + if ( !set ) { |
| 1574 | + set = context.getElementsByTagName("*"); |
| 1575 | + } |
| 1576 | + |
| 1577 | + return {set: set, expr: expr}; |
| 1578 | +}; |
| 1579 | + |
| 1580 | +Sizzle.filter = function(expr, set, inplace, not){ |
| 1581 | + var old = expr, result = [], curLoop = set, match, anyFound, |
| 1582 | + isXMLFilter = set && set[0] && isXML(set[0]); |
| 1583 | + |
| 1584 | + while ( expr && set.length ) { |
| 1585 | + for ( var type in Expr.filter ) { |
| 1586 | + if ( (match = Expr.match[ type ].exec( expr )) != null ) { |
| 1587 | + var filter = Expr.filter[ type ], found, item; |
| 1588 | + anyFound = false; |
| 1589 | + |
| 1590 | + if ( curLoop == result ) { |
| 1591 | + result = []; |
| 1592 | + } |
| 1593 | + |
| 1594 | + if ( Expr.preFilter[ type ] ) { |
| 1595 | + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); |
| 1596 | + |
| 1597 | + if ( !match ) { |
| 1598 | + anyFound = found = true; |
| 1599 | + } else if ( match === true ) { |
| 1600 | + continue; |
| 1601 | + } |
| 1602 | + } |
| 1603 | + |
| 1604 | + if ( match ) { |
| 1605 | + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { |
| 1606 | + if ( item ) { |
| 1607 | + found = filter( item, match, i, curLoop ); |
| 1608 | + var pass = not ^ !!found; |
| 1609 | + |
| 1610 | + if ( inplace && found != null ) { |
| 1611 | + if ( pass ) { |
| 1612 | + anyFound = true; |
| 1613 | + } else { |
| 1614 | + curLoop[i] = false; |
| 1615 | + } |
| 1616 | + } else if ( pass ) { |
| 1617 | + result.push( item ); |
| 1618 | + anyFound = true; |
| 1619 | + } |
| 1620 | + } |
| 1621 | + } |
| 1622 | + } |
| 1623 | + |
| 1624 | + if ( found !== undefined ) { |
| 1625 | + if ( !inplace ) { |
| 1626 | + curLoop = result; |
| 1627 | + } |
| 1628 | + |
| 1629 | + expr = expr.replace( Expr.match[ type ], "" ); |
| 1630 | + |
| 1631 | + if ( !anyFound ) { |
| 1632 | + return []; |
| 1633 | + } |
| 1634 | + |
| 1635 | + break; |
| 1636 | + } |
| 1637 | + } |
| 1638 | + } |
| 1639 | + |
| 1640 | + // Improper expression |
| 1641 | + if ( expr == old ) { |
| 1642 | + if ( anyFound == null ) { |
| 1643 | + throw "Syntax error, unrecognized expression: " + expr; |
| 1644 | + } else { |
| 1645 | + break; |
| 1646 | + } |
| 1647 | + } |
| 1648 | + |
| 1649 | + old = expr; |
| 1650 | + } |
| 1651 | + |
| 1652 | + return curLoop; |
| 1653 | +}; |
| 1654 | + |
| 1655 | +var Expr = Sizzle.selectors = { |
| 1656 | + order: [ "ID", "NAME", "TAG" ], |
| 1657 | + match: { |
| 1658 | + ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, |
| 1659 | + CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, |
| 1660 | + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, |
| 1661 | + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, |
| 1662 | + TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, |
| 1663 | + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, |
| 1664 | + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, |
| 1665 | + PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ |
| 1666 | + }, |
| 1667 | + attrMap: { |
| 1668 | + "class": "className", |
| 1669 | + "for": "htmlFor" |
| 1670 | + }, |
| 1671 | + attrHandle: { |
| 1672 | + href: function(elem){ |
| 1673 | + return elem.getAttribute("href"); |
| 1674 | + } |
| 1675 | + }, |
| 1676 | + relative: { |
| 1677 | + "+": function(checkSet, part, isXML){ |
| 1678 | + var isPartStr = typeof part === "string", |
| 1679 | + isTag = isPartStr && !/\W/.test(part), |
| 1680 | + isPartStrNotTag = isPartStr && !isTag; |
| 1681 | + |
| 1682 | + if ( isTag && !isXML ) { |
| 1683 | + part = part.toUpperCase(); |
| 1684 | + } |
| 1685 | + |
| 1686 | + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { |
| 1687 | + if ( (elem = checkSet[i]) ) { |
| 1688 | + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} |
| 1689 | + |
| 1690 | + checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? |
| 1691 | + elem || false : |
| 1692 | + elem === part; |
| 1693 | + } |
| 1694 | + } |
| 1695 | + |
| 1696 | + if ( isPartStrNotTag ) { |
| 1697 | + Sizzle.filter( part, checkSet, true ); |
| 1698 | + } |
| 1699 | + }, |
| 1700 | + ">": function(checkSet, part, isXML){ |
| 1701 | + var isPartStr = typeof part === "string"; |
| 1702 | + |
| 1703 | + if ( isPartStr && !/\W/.test(part) ) { |
| 1704 | + part = isXML ? part : part.toUpperCase(); |
| 1705 | + |
| 1706 | + for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
| 1707 | + var elem = checkSet[i]; |
| 1708 | + if ( elem ) { |
| 1709 | + var parent = elem.parentNode; |
| 1710 | + checkSet[i] = parent.nodeName === part ? parent : false; |
| 1711 | + } |
| 1712 | + } |
| 1713 | + } else { |
| 1714 | + for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
| 1715 | + var elem = checkSet[i]; |
| 1716 | + if ( elem ) { |
| 1717 | + checkSet[i] = isPartStr ? |
| 1718 | + elem.parentNode : |
| 1719 | + elem.parentNode === part; |
| 1720 | + } |
| 1721 | + } |
| 1722 | + |
| 1723 | + if ( isPartStr ) { |
| 1724 | + Sizzle.filter( part, checkSet, true ); |
| 1725 | + } |
| 1726 | + } |
| 1727 | + }, |
| 1728 | + "": function(checkSet, part, isXML){ |
| 1729 | + var doneName = done++, checkFn = dirCheck; |
| 1730 | + |
| 1731 | + if ( !part.match(/\W/) ) { |
| 1732 | + var nodeCheck = part = isXML ? part : part.toUpperCase(); |
| 1733 | + checkFn = dirNodeCheck; |
| 1734 | + } |
| 1735 | + |
| 1736 | + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); |
| 1737 | + }, |
| 1738 | + "~": function(checkSet, part, isXML){ |
| 1739 | + var doneName = done++, checkFn = dirCheck; |
| 1740 | + |
| 1741 | + if ( typeof part === "string" && !part.match(/\W/) ) { |
| 1742 | + var nodeCheck = part = isXML ? part : part.toUpperCase(); |
| 1743 | + checkFn = dirNodeCheck; |
| 1744 | + } |
| 1745 | + |
| 1746 | + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); |
| 1747 | + } |
| 1748 | + }, |
| 1749 | + find: { |
| 1750 | + ID: function(match, context, isXML){ |
| 1751 | + if ( typeof context.getElementById !== "undefined" && !isXML ) { |
| 1752 | + var m = context.getElementById(match[1]); |
| 1753 | + return m ? [m] : []; |
| 1754 | + } |
| 1755 | + }, |
| 1756 | + NAME: function(match, context, isXML){ |
| 1757 | + if ( typeof context.getElementsByName !== "undefined" ) { |
| 1758 | + var ret = [], results = context.getElementsByName(match[1]); |
| 1759 | + |
| 1760 | + for ( var i = 0, l = results.length; i < l; i++ ) { |
| 1761 | + if ( results[i].getAttribute("name") === match[1] ) { |
| 1762 | + ret.push( results[i] ); |
| 1763 | + } |
| 1764 | + } |
| 1765 | + |
| 1766 | + return ret.length === 0 ? null : ret; |
| 1767 | + } |
| 1768 | + }, |
| 1769 | + TAG: function(match, context){ |
| 1770 | + return context.getElementsByTagName(match[1]); |
| 1771 | + } |
| 1772 | + }, |
| 1773 | + preFilter: { |
| 1774 | + CLASS: function(match, curLoop, inplace, result, not, isXML){ |
| 1775 | + match = " " + match[1].replace(/\\/g, "") + " "; |
| 1776 | + |
| 1777 | + if ( isXML ) { |
| 1778 | + return match; |
| 1779 | + } |
| 1780 | + |
| 1781 | + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { |
| 1782 | + if ( elem ) { |
| 1783 | + if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { |
| 1784 | + if ( !inplace ) |
| 1785 | + result.push( elem ); |
| 1786 | + } else if ( inplace ) { |
| 1787 | + curLoop[i] = false; |
| 1788 | + } |
| 1789 | + } |
| 1790 | + } |
| 1791 | + |
| 1792 | + return false; |
| 1793 | + }, |
| 1794 | + ID: function(match){ |
| 1795 | + return match[1].replace(/\\/g, ""); |
| 1796 | + }, |
| 1797 | + TAG: function(match, curLoop){ |
| 1798 | + for ( var i = 0; curLoop[i] === false; i++ ){} |
| 1799 | + return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); |
| 1800 | + }, |
| 1801 | + CHILD: function(match){ |
| 1802 | + if ( match[1] == "nth" ) { |
| 1803 | + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' |
| 1804 | + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( |
| 1805 | + match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || |
| 1806 | + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); |
| 1807 | + |
| 1808 | + // calculate the numbers (first)n+(last) including if they are negative |
| 1809 | + match[2] = (test[1] + (test[2] || 1)) - 0; |
| 1810 | + match[3] = test[3] - 0; |
| 1811 | + } |
| 1812 | + |
| 1813 | + // TODO: Move to normal caching system |
| 1814 | + match[0] = done++; |
| 1815 | + |
| 1816 | + return match; |
| 1817 | + }, |
| 1818 | + ATTR: function(match, curLoop, inplace, result, not, isXML){ |
| 1819 | + var name = match[1].replace(/\\/g, ""); |
| 1820 | + |
| 1821 | + if ( !isXML && Expr.attrMap[name] ) { |
| 1822 | + match[1] = Expr.attrMap[name]; |
| 1823 | + } |
| 1824 | + |
| 1825 | + if ( match[2] === "~=" ) { |
| 1826 | + match[4] = " " + match[4] + " "; |
| 1827 | + } |
| 1828 | + |
| 1829 | + return match; |
| 1830 | + }, |
| 1831 | + PSEUDO: function(match, curLoop, inplace, result, not){ |
| 1832 | + if ( match[1] === "not" ) { |
| 1833 | + // If we're dealing with a complex expression, or a simple one |
| 1834 | + if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) { |
| 1835 | + match[3] = Sizzle(match[3], null, null, curLoop); |
| 1836 | + } else { |
| 1837 | + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); |
| 1838 | + if ( !inplace ) { |
| 1839 | + result.push.apply( result, ret ); |
| 1840 | + } |
| 1841 | + return false; |
| 1842 | + } |
| 1843 | + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { |
| 1844 | + return true; |
| 1845 | + } |
| 1846 | + |
| 1847 | + return match; |
| 1848 | + }, |
| 1849 | + POS: function(match){ |
| 1850 | + match.unshift( true ); |
| 1851 | + return match; |
| 1852 | + } |
| 1853 | + }, |
| 1854 | + filters: { |
| 1855 | + enabled: function(elem){ |
| 1856 | + return elem.disabled === false && elem.type !== "hidden"; |
| 1857 | + }, |
| 1858 | + disabled: function(elem){ |
| 1859 | + return elem.disabled === true; |
| 1860 | + }, |
| 1861 | + checked: function(elem){ |
| 1862 | + return elem.checked === true; |
| 1863 | + }, |
| 1864 | + selected: function(elem){ |
| 1865 | + // Accessing this property makes selected-by-default |
| 1866 | + // options in Safari work properly |
| 1867 | + elem.parentNode.selectedIndex; |
| 1868 | + return elem.selected === true; |
| 1869 | + }, |
| 1870 | + parent: function(elem){ |
| 1871 | + return !!elem.firstChild; |
| 1872 | + }, |
| 1873 | + empty: function(elem){ |
| 1874 | + return !elem.firstChild; |
| 1875 | + }, |
| 1876 | + has: function(elem, i, match){ |
| 1877 | + return !!Sizzle( match[3], elem ).length; |
| 1878 | + }, |
| 1879 | + header: function(elem){ |
| 1880 | + return /h\d/i.test( elem.nodeName ); |
| 1881 | + }, |
| 1882 | + text: function(elem){ |
| 1883 | + return "text" === elem.type; |
| 1884 | + }, |
| 1885 | + radio: function(elem){ |
| 1886 | + return "radio" === elem.type; |
| 1887 | + }, |
| 1888 | + checkbox: function(elem){ |
| 1889 | + return "checkbox" === elem.type; |
| 1890 | + }, |
| 1891 | + file: function(elem){ |
| 1892 | + return "file" === elem.type; |
| 1893 | + }, |
| 1894 | + password: function(elem){ |
| 1895 | + return "password" === elem.type; |
| 1896 | + }, |
| 1897 | + submit: function(elem){ |
| 1898 | + return "submit" === elem.type; |
| 1899 | + }, |
| 1900 | + image: function(elem){ |
| 1901 | + return "image" === elem.type; |
| 1902 | + }, |
| 1903 | + reset: function(elem){ |
| 1904 | + return "reset" === elem.type; |
| 1905 | + }, |
| 1906 | + button: function(elem){ |
| 1907 | + return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; |
| 1908 | + }, |
| 1909 | + input: function(elem){ |
| 1910 | + return /input|select|textarea|button/i.test(elem.nodeName); |
| 1911 | + } |
| 1912 | + }, |
| 1913 | + setFilters: { |
| 1914 | + first: function(elem, i){ |
| 1915 | + return i === 0; |
| 1916 | + }, |
| 1917 | + last: function(elem, i, match, array){ |
| 1918 | + return i === array.length - 1; |
| 1919 | + }, |
| 1920 | + even: function(elem, i){ |
| 1921 | + return i % 2 === 0; |
| 1922 | + }, |
| 1923 | + odd: function(elem, i){ |
| 1924 | + return i % 2 === 1; |
| 1925 | + }, |
| 1926 | + lt: function(elem, i, match){ |
| 1927 | + return i < match[3] - 0; |
| 1928 | + }, |
| 1929 | + gt: function(elem, i, match){ |
| 1930 | + return i > match[3] - 0; |
| 1931 | + }, |
| 1932 | + nth: function(elem, i, match){ |
| 1933 | + return match[3] - 0 == i; |
| 1934 | + }, |
| 1935 | + eq: function(elem, i, match){ |
| 1936 | + return match[3] - 0 == i; |
| 1937 | + } |
| 1938 | + }, |
| 1939 | + filter: { |
| 1940 | + PSEUDO: function(elem, match, i, array){ |
| 1941 | + var name = match[1], filter = Expr.filters[ name ]; |
| 1942 | + |
| 1943 | + if ( filter ) { |
| 1944 | + return filter( elem, i, match, array ); |
| 1945 | + } else if ( name === "contains" ) { |
| 1946 | + return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; |
| 1947 | + } else if ( name === "not" ) { |
| 1948 | + var not = match[3]; |
| 1949 | + |
| 1950 | + for ( var i = 0, l = not.length; i < l; i++ ) { |
| 1951 | + if ( not[i] === elem ) { |
| 1952 | + return false; |
| 1953 | + } |
| 1954 | + } |
| 1955 | + |
| 1956 | + return true; |
| 1957 | + } |
| 1958 | + }, |
| 1959 | + CHILD: function(elem, match){ |
| 1960 | + var type = match[1], node = elem; |
| 1961 | + switch (type) { |
| 1962 | + case 'only': |
| 1963 | + case 'first': |
| 1964 | + while (node = node.previousSibling) { |
| 1965 | + if ( node.nodeType === 1 ) return false; |
| 1966 | + } |
| 1967 | + if ( type == 'first') return true; |
| 1968 | + node = elem; |
| 1969 | + case 'last': |
| 1970 | + while (node = node.nextSibling) { |
| 1971 | + if ( node.nodeType === 1 ) return false; |
| 1972 | + } |
| 1973 | + return true; |
| 1974 | + case 'nth': |
| 1975 | + var first = match[2], last = match[3]; |
| 1976 | + |
| 1977 | + if ( first == 1 && last == 0 ) { |
| 1978 | + return true; |
| 1979 | + } |
| 1980 | + |
| 1981 | + var doneName = match[0], |
| 1982 | + parent = elem.parentNode; |
| 1983 | + |
| 1984 | + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { |
| 1985 | + var count = 0; |
| 1986 | + for ( node = parent.firstChild; node; node = node.nextSibling ) { |
| 1987 | + if ( node.nodeType === 1 ) { |
| 1988 | + node.nodeIndex = ++count; |
| 1989 | + } |
| 1990 | + } |
| 1991 | + parent.sizcache = doneName; |
| 1992 | + } |
| 1993 | + |
| 1994 | + var diff = elem.nodeIndex - last; |
| 1995 | + if ( first == 0 ) { |
| 1996 | + return diff == 0; |
| 1997 | + } else { |
| 1998 | + return ( diff % first == 0 && diff / first >= 0 ); |
| 1999 | + } |
| 2000 | + } |
| 2001 | + }, |
| 2002 | + ID: function(elem, match){ |
| 2003 | + return elem.nodeType === 1 && elem.getAttribute("id") === match; |
| 2004 | + }, |
| 2005 | + TAG: function(elem, match){ |
| 2006 | + return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; |
| 2007 | + }, |
| 2008 | + CLASS: function(elem, match){ |
| 2009 | + return (" " + (elem.className || elem.getAttribute("class")) + " ") |
| 2010 | + .indexOf( match ) > -1; |
| 2011 | + }, |
| 2012 | + ATTR: function(elem, match){ |
| 2013 | + var name = match[1], |
| 2014 | + result = Expr.attrHandle[ name ] ? |
| 2015 | + Expr.attrHandle[ name ]( elem ) : |
| 2016 | + elem[ name ] != null ? |
| 2017 | + elem[ name ] : |
| 2018 | + elem.getAttribute( name ), |
| 2019 | + value = result + "", |
| 2020 | + type = match[2], |
| 2021 | + check = match[4]; |
| 2022 | + |
| 2023 | + return result == null ? |
| 2024 | + type === "!=" : |
| 2025 | + type === "=" ? |
| 2026 | + value === check : |
| 2027 | + type === "*=" ? |
| 2028 | + value.indexOf(check) >= 0 : |
| 2029 | + type === "~=" ? |
| 2030 | + (" " + value + " ").indexOf(check) >= 0 : |
| 2031 | + !check ? |
| 2032 | + value && result !== false : |
| 2033 | + type === "!=" ? |
| 2034 | + value != check : |
| 2035 | + type === "^=" ? |
| 2036 | + value.indexOf(check) === 0 : |
| 2037 | + type === "$=" ? |
| 2038 | + value.substr(value.length - check.length) === check : |
| 2039 | + type === "|=" ? |
| 2040 | + value === check || value.substr(0, check.length + 1) === check + "-" : |
| 2041 | + false; |
| 2042 | + }, |
| 2043 | + POS: function(elem, match, i, array){ |
| 2044 | + var name = match[2], filter = Expr.setFilters[ name ]; |
| 2045 | + |
| 2046 | + if ( filter ) { |
| 2047 | + return filter( elem, i, match, array ); |
| 2048 | + } |
| 2049 | + } |
| 2050 | + } |
| 2051 | +}; |
| 2052 | + |
| 2053 | +var origPOS = Expr.match.POS; |
| 2054 | + |
| 2055 | +for ( var type in Expr.match ) { |
| 2056 | + Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); |
| 2057 | +} |
| 2058 | + |
| 2059 | +var makeArray = function(array, results) { |
| 2060 | + array = Array.prototype.slice.call( array ); |
| 2061 | + |
| 2062 | + if ( results ) { |
| 2063 | + results.push.apply( results, array ); |
| 2064 | + return results; |
| 2065 | + } |
| 2066 | + |
| 2067 | + return array; |
| 2068 | +}; |
| 2069 | + |
| 2070 | +// Perform a simple check to determine if the browser is capable of |
| 2071 | +// converting a NodeList to an array using builtin methods. |
| 2072 | +try { |
| 2073 | + Array.prototype.slice.call( document.documentElement.childNodes ); |
| 2074 | + |
| 2075 | +// Provide a fallback method if it does not work |
| 2076 | +} catch(e){ |
| 2077 | + makeArray = function(array, results) { |
| 2078 | + var ret = results || []; |
| 2079 | + |
| 2080 | + if ( toString.call(array) === "[object Array]" ) { |
| 2081 | + Array.prototype.push.apply( ret, array ); |
| 2082 | + } else { |
| 2083 | + if ( typeof array.length === "number" ) { |
| 2084 | + for ( var i = 0, l = array.length; i < l; i++ ) { |
| 2085 | + ret.push( array[i] ); |
| 2086 | + } |
| 2087 | + } else { |
| 2088 | + for ( var i = 0; array[i]; i++ ) { |
| 2089 | + ret.push( array[i] ); |
| 2090 | + } |
| 2091 | + } |
| 2092 | + } |
| 2093 | + |
| 2094 | + return ret; |
| 2095 | + }; |
| 2096 | +} |
| 2097 | + |
| 2098 | +var sortOrder; |
| 2099 | + |
| 2100 | +if ( document.documentElement.compareDocumentPosition ) { |
| 2101 | + sortOrder = function( a, b ) { |
| 2102 | + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; |
| 2103 | + if ( ret === 0 ) { |
| 2104 | + hasDuplicate = true; |
| 2105 | + } |
| 2106 | + return ret; |
| 2107 | + }; |
| 2108 | +} else if ( "sourceIndex" in document.documentElement ) { |
| 2109 | + sortOrder = function( a, b ) { |
| 2110 | + var ret = a.sourceIndex - b.sourceIndex; |
| 2111 | + if ( ret === 0 ) { |
| 2112 | + hasDuplicate = true; |
| 2113 | + } |
| 2114 | + return ret; |
| 2115 | + }; |
| 2116 | +} else if ( document.createRange ) { |
| 2117 | + sortOrder = function( a, b ) { |
| 2118 | + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); |
| 2119 | + aRange.selectNode(a); |
| 2120 | + aRange.collapse(true); |
| 2121 | + bRange.selectNode(b); |
| 2122 | + bRange.collapse(true); |
| 2123 | + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); |
| 2124 | + if ( ret === 0 ) { |
| 2125 | + hasDuplicate = true; |
| 2126 | + } |
| 2127 | + return ret; |
| 2128 | + }; |
| 2129 | +} |
| 2130 | + |
| 2131 | +// Check to see if the browser returns elements by name when |
| 2132 | +// querying by getElementById (and provide a workaround) |
| 2133 | +(function(){ |
| 2134 | + // We're going to inject a fake input element with a specified name |
| 2135 | + var form = document.createElement("form"), |
| 2136 | + id = "script" + (new Date).getTime(); |
| 2137 | + form.innerHTML = "<input name='" + id + "'/>"; |
| 2138 | + |
| 2139 | + // Inject it into the root element, check its status, and remove it quickly |
| 2140 | + var root = document.documentElement; |
| 2141 | + root.insertBefore( form, root.firstChild ); |
| 2142 | + |
| 2143 | + // The workaround has to do additional checks after a getElementById |
| 2144 | + // Which slows things down for other browsers (hence the branching) |
| 2145 | + if ( !!document.getElementById( id ) ) { |
| 2146 | + Expr.find.ID = function(match, context, isXML){ |
| 2147 | + if ( typeof context.getElementById !== "undefined" && !isXML ) { |
| 2148 | + var m = context.getElementById(match[1]); |
| 2149 | + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; |
| 2150 | + } |
| 2151 | + }; |
| 2152 | + |
| 2153 | + Expr.filter.ID = function(elem, match){ |
| 2154 | + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); |
| 2155 | + return elem.nodeType === 1 && node && node.nodeValue === match; |
| 2156 | + }; |
| 2157 | + } |
| 2158 | + |
| 2159 | + root.removeChild( form ); |
| 2160 | +})(); |
| 2161 | + |
| 2162 | +(function(){ |
| 2163 | + // Check to see if the browser returns only elements |
| 2164 | + // when doing getElementsByTagName("*") |
| 2165 | + |
| 2166 | + // Create a fake element |
| 2167 | + var div = document.createElement("div"); |
| 2168 | + div.appendChild( document.createComment("") ); |
| 2169 | + |
| 2170 | + // Make sure no comments are found |
| 2171 | + if ( div.getElementsByTagName("*").length > 0 ) { |
| 2172 | + Expr.find.TAG = function(match, context){ |
| 2173 | + var results = context.getElementsByTagName(match[1]); |
| 2174 | + |
| 2175 | + // Filter out possible comments |
| 2176 | + if ( match[1] === "*" ) { |
| 2177 | + var tmp = []; |
| 2178 | + |
| 2179 | + for ( var i = 0; results[i]; i++ ) { |
| 2180 | + if ( results[i].nodeType === 1 ) { |
| 2181 | + tmp.push( results[i] ); |
| 2182 | + } |
| 2183 | + } |
| 2184 | + |
| 2185 | + results = tmp; |
| 2186 | + } |
| 2187 | + |
| 2188 | + return results; |
| 2189 | + }; |
| 2190 | + } |
| 2191 | + |
| 2192 | + // Check to see if an attribute returns normalized href attributes |
| 2193 | + div.innerHTML = "<a href='#'></a>"; |
| 2194 | + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && |
| 2195 | + div.firstChild.getAttribute("href") !== "#" ) { |
| 2196 | + Expr.attrHandle.href = function(elem){ |
| 2197 | + return elem.getAttribute("href", 2); |
| 2198 | + }; |
| 2199 | + } |
| 2200 | +})(); |
| 2201 | + |
| 2202 | +if ( document.querySelectorAll ) (function(){ |
| 2203 | + var oldSizzle = Sizzle, div = document.createElement("div"); |
| 2204 | + div.innerHTML = "<p class='TEST'></p>"; |
| 2205 | + |
| 2206 | + // Safari can't handle uppercase or unicode characters when |
| 2207 | + // in quirks mode. |
| 2208 | + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { |
| 2209 | + return; |
| 2210 | + } |
| 2211 | + |
| 2212 | + Sizzle = function(query, context, extra, seed){ |
| 2213 | + context = context || document; |
| 2214 | + |
| 2215 | + // Only use querySelectorAll on non-XML documents |
| 2216 | + // (ID selectors don't work in non-HTML documents) |
| 2217 | + if ( !seed && context.nodeType === 9 && !isXML(context) ) { |
| 2218 | + try { |
| 2219 | + return makeArray( context.querySelectorAll(query), extra ); |
| 2220 | + } catch(e){} |
| 2221 | + } |
| 2222 | + |
| 2223 | + return oldSizzle(query, context, extra, seed); |
| 2224 | + }; |
| 2225 | + |
| 2226 | + Sizzle.find = oldSizzle.find; |
| 2227 | + Sizzle.filter = oldSizzle.filter; |
| 2228 | + Sizzle.selectors = oldSizzle.selectors; |
| 2229 | + Sizzle.matches = oldSizzle.matches; |
| 2230 | +})(); |
| 2231 | + |
| 2232 | +if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ |
| 2233 | + var div = document.createElement("div"); |
| 2234 | + div.innerHTML = "<div class='test e'></div><div class='test'></div>"; |
| 2235 | + |
| 2236 | + // Opera can't find a second classname (in 9.6) |
| 2237 | + if ( div.getElementsByClassName("e").length === 0 ) |
| 2238 | + return; |
| 2239 | + |
| 2240 | + // Safari caches class attributes, doesn't catch changes (in 3.2) |
| 2241 | + div.lastChild.className = "e"; |
| 2242 | + |
| 2243 | + if ( div.getElementsByClassName("e").length === 1 ) |
| 2244 | + return; |
| 2245 | + |
| 2246 | + Expr.order.splice(1, 0, "CLASS"); |
| 2247 | + Expr.find.CLASS = function(match, context, isXML) { |
| 2248 | + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { |
| 2249 | + return context.getElementsByClassName(match[1]); |
| 2250 | + } |
| 2251 | + }; |
| 2252 | +})(); |
| 2253 | + |
| 2254 | +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { |
| 2255 | + var sibDir = dir == "previousSibling" && !isXML; |
| 2256 | + for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
| 2257 | + var elem = checkSet[i]; |
| 2258 | + if ( elem ) { |
| 2259 | + if ( sibDir && elem.nodeType === 1 ){ |
| 2260 | + elem.sizcache = doneName; |
| 2261 | + elem.sizset = i; |
| 2262 | + } |
| 2263 | + elem = elem[dir]; |
| 2264 | + var match = false; |
| 2265 | + |
| 2266 | + while ( elem ) { |
| 2267 | + if ( elem.sizcache === doneName ) { |
| 2268 | + match = checkSet[elem.sizset]; |
| 2269 | + break; |
| 2270 | + } |
| 2271 | + |
| 2272 | + if ( elem.nodeType === 1 && !isXML ){ |
| 2273 | + elem.sizcache = doneName; |
| 2274 | + elem.sizset = i; |
| 2275 | + } |
| 2276 | + |
| 2277 | + if ( elem.nodeName === cur ) { |
| 2278 | + match = elem; |
| 2279 | + break; |
| 2280 | + } |
| 2281 | + |
| 2282 | + elem = elem[dir]; |
| 2283 | + } |
| 2284 | + |
| 2285 | + checkSet[i] = match; |
| 2286 | + } |
| 2287 | + } |
| 2288 | +} |
| 2289 | + |
| 2290 | +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { |
| 2291 | + var sibDir = dir == "previousSibling" && !isXML; |
| 2292 | + for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
| 2293 | + var elem = checkSet[i]; |
| 2294 | + if ( elem ) { |
| 2295 | + if ( sibDir && elem.nodeType === 1 ) { |
| 2296 | + elem.sizcache = doneName; |
| 2297 | + elem.sizset = i; |
| 2298 | + } |
| 2299 | + elem = elem[dir]; |
| 2300 | + var match = false; |
| 2301 | + |
| 2302 | + while ( elem ) { |
| 2303 | + if ( elem.sizcache === doneName ) { |
| 2304 | + match = checkSet[elem.sizset]; |
| 2305 | + break; |
| 2306 | + } |
| 2307 | + |
| 2308 | + if ( elem.nodeType === 1 ) { |
| 2309 | + if ( !isXML ) { |
| 2310 | + elem.sizcache = doneName; |
| 2311 | + elem.sizset = i; |
| 2312 | + } |
| 2313 | + if ( typeof cur !== "string" ) { |
| 2314 | + if ( elem === cur ) { |
| 2315 | + match = true; |
| 2316 | + break; |
| 2317 | + } |
| 2318 | + |
| 2319 | + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { |
| 2320 | + match = elem; |
| 2321 | + break; |
| 2322 | + } |
| 2323 | + } |
| 2324 | + |
| 2325 | + elem = elem[dir]; |
| 2326 | + } |
| 2327 | + |
| 2328 | + checkSet[i] = match; |
| 2329 | + } |
| 2330 | + } |
| 2331 | +} |
| 2332 | + |
| 2333 | +var contains = document.compareDocumentPosition ? function(a, b){ |
| 2334 | + return a.compareDocumentPosition(b) & 16; |
| 2335 | +} : function(a, b){ |
| 2336 | + return a !== b && (a.contains ? a.contains(b) : true); |
| 2337 | +}; |
| 2338 | + |
| 2339 | +var isXML = function(elem){ |
| 2340 | + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || |
| 2341 | + !!elem.ownerDocument && isXML( elem.ownerDocument ); |
| 2342 | +}; |
| 2343 | + |
| 2344 | +var posProcess = function(selector, context){ |
| 2345 | + var tmpSet = [], later = "", match, |
| 2346 | + root = context.nodeType ? [context] : context; |
| 2347 | + |
| 2348 | + // Position selectors must be done after the filter |
| 2349 | + // And so must :not(positional) so we move all PSEUDOs to the end |
| 2350 | + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { |
| 2351 | + later += match[0]; |
| 2352 | + selector = selector.replace( Expr.match.PSEUDO, "" ); |
| 2353 | + } |
| 2354 | + |
| 2355 | + selector = Expr.relative[selector] ? selector + "*" : selector; |
| 2356 | + |
| 2357 | + for ( var i = 0, l = root.length; i < l; i++ ) { |
| 2358 | + Sizzle( selector, root[i], tmpSet ); |
| 2359 | + } |
| 2360 | + |
| 2361 | + return Sizzle.filter( later, tmpSet ); |
| 2362 | +}; |
| 2363 | + |
| 2364 | +// EXPOSE |
| 2365 | +jQuery.find = Sizzle; |
| 2366 | +jQuery.filter = Sizzle.filter; |
| 2367 | +jQuery.expr = Sizzle.selectors; |
| 2368 | +jQuery.expr[":"] = jQuery.expr.filters; |
| 2369 | + |
| 2370 | +Sizzle.selectors.filters.hidden = function(elem){ |
| 2371 | + return elem.offsetWidth === 0 || elem.offsetHeight === 0; |
| 2372 | +}; |
| 2373 | + |
| 2374 | +Sizzle.selectors.filters.visible = function(elem){ |
| 2375 | + return elem.offsetWidth > 0 || elem.offsetHeight > 0; |
| 2376 | +}; |
| 2377 | + |
| 2378 | +Sizzle.selectors.filters.animated = function(elem){ |
| 2379 | + return jQuery.grep(jQuery.timers, function(fn){ |
| 2380 | + return elem === fn.elem; |
| 2381 | + }).length; |
| 2382 | +}; |
| 2383 | + |
| 2384 | +jQuery.multiFilter = function( expr, elems, not ) { |
| 2385 | + if ( not ) { |
| 2386 | + expr = ":not(" + expr + ")"; |
| 2387 | + } |
| 2388 | + |
| 2389 | + return Sizzle.matches(expr, elems); |
| 2390 | +}; |
| 2391 | + |
| 2392 | +jQuery.dir = function( elem, dir ){ |
| 2393 | + var matched = [], cur = elem[dir]; |
| 2394 | + while ( cur && cur != document ) { |
| 2395 | + if ( cur.nodeType == 1 ) |
| 2396 | + matched.push( cur ); |
| 2397 | + cur = cur[dir]; |
| 2398 | + } |
| 2399 | + return matched; |
| 2400 | +}; |
| 2401 | + |
| 2402 | +jQuery.nth = function(cur, result, dir, elem){ |
| 2403 | + result = result || 1; |
| 2404 | + var num = 0; |
| 2405 | + |
| 2406 | + for ( ; cur; cur = cur[dir] ) |
| 2407 | + if ( cur.nodeType == 1 && ++num == result ) |
| 2408 | + break; |
| 2409 | + |
| 2410 | + return cur; |
| 2411 | +}; |
| 2412 | + |
| 2413 | +jQuery.sibling = function(n, elem){ |
| 2414 | + var r = []; |
| 2415 | + |
| 2416 | + for ( ; n; n = n.nextSibling ) { |
| 2417 | + if ( n.nodeType == 1 && n != elem ) |
| 2418 | + r.push( n ); |
| 2419 | + } |
| 2420 | + |
| 2421 | + return r; |
| 2422 | +}; |
| 2423 | + |
| 2424 | +return; |
| 2425 | + |
| 2426 | +window.Sizzle = Sizzle; |
| 2427 | + |
| 2428 | +})(); |
| 2429 | +/* |
| 2430 | + * A number of helper functions used for managing events. |
| 2431 | + * Many of the ideas behind this code originated from |
| 2432 | + * Dean Edwards' addEvent library. |
| 2433 | + */ |
| 2434 | +jQuery.event = { |
| 2435 | + |
| 2436 | + // Bind an event to an element |
| 2437 | + // Original by Dean Edwards |
| 2438 | + add: function(elem, types, handler, data) { |
| 2439 | + if ( elem.nodeType == 3 || elem.nodeType == 8 ) |
| 2440 | + return; |
| 2441 | + |
| 2442 | + // For whatever reason, IE has trouble passing the window object |
| 2443 | + // around, causing it to be cloned in the process |
| 2444 | + if ( elem.setInterval && elem != window ) |
| 2445 | + elem = window; |
| 2446 | + |
| 2447 | + // Make sure that the function being executed has a unique ID |
| 2448 | + if ( !handler.guid ) |
| 2449 | + handler.guid = this.guid++; |
| 2450 | + |
| 2451 | + // if data is passed, bind to handler |
| 2452 | + if ( data !== undefined ) { |
| 2453 | + // Create temporary function pointer to original handler |
| 2454 | + var fn = handler; |
| 2455 | + |
| 2456 | + // Create unique handler function, wrapped around original handler |
| 2457 | + handler = this.proxy( fn ); |
| 2458 | + |
| 2459 | + // Store data in unique handler |
| 2460 | + handler.data = data; |
| 2461 | + } |
| 2462 | + |
| 2463 | + // Init the element's event structure |
| 2464 | + var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), |
| 2465 | + handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ |
| 2466 | + // Handle the second event of a trigger and when |
| 2467 | + // an event is called after a page has unloaded |
| 2468 | + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? |
| 2469 | + jQuery.event.handle.apply(arguments.callee.elem, arguments) : |
| 2470 | + undefined; |
| 2471 | + }); |
| 2472 | + // Add elem as a property of the handle function |
| 2473 | + // This is to prevent a memory leak with non-native |
| 2474 | + // event in IE. |
| 2475 | + handle.elem = elem; |
| 2476 | + |
| 2477 | + // Handle multiple events separated by a space |
| 2478 | + // jQuery(...).bind("mouseover mouseout", fn); |
| 2479 | + jQuery.each(types.split(/\s+/), function(index, type) { |
| 2480 | + // Namespaced event handlers |
| 2481 | + var namespaces = type.split("."); |
| 2482 | + type = namespaces.shift(); |
| 2483 | + handler.type = namespaces.slice().sort().join("."); |
| 2484 | + |
| 2485 | + // Get the current list of functions bound to this event |
| 2486 | + var handlers = events[type]; |
| 2487 | + |
| 2488 | + if ( jQuery.event.specialAll[type] ) |
| 2489 | + jQuery.event.specialAll[type].setup.call(elem, data, namespaces); |
| 2490 | + |
| 2491 | + // Init the event handler queue |
| 2492 | + if (!handlers) { |
| 2493 | + handlers = events[type] = {}; |
| 2494 | + |
| 2495 | + // Check for a special event handler |
| 2496 | + // Only use addEventListener/attachEvent if the special |
| 2497 | + // events handler returns false |
| 2498 | + if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { |
| 2499 | + // Bind the global event handler to the element |
| 2500 | + if (elem.addEventListener) |
| 2501 | + elem.addEventListener(type, handle, false); |
| 2502 | + else if (elem.attachEvent) |
| 2503 | + elem.attachEvent("on" + type, handle); |
| 2504 | + } |
| 2505 | + } |
| 2506 | + |
| 2507 | + // Add the function to the element's handler list |
| 2508 | + handlers[handler.guid] = handler; |
| 2509 | + |
| 2510 | + // Keep track of which events have been used, for global triggering |
| 2511 | + jQuery.event.global[type] = true; |
| 2512 | + }); |
| 2513 | + |
| 2514 | + // Nullify elem to prevent memory leaks in IE |
| 2515 | + elem = null; |
| 2516 | + }, |
| 2517 | + |
| 2518 | + guid: 1, |
| 2519 | + global: {}, |
| 2520 | + |
| 2521 | + // Detach an event or set of events from an element |
| 2522 | + remove: function(elem, types, handler) { |
| 2523 | + // don't do events on text and comment nodes |
| 2524 | + if ( elem.nodeType == 3 || elem.nodeType == 8 ) |
| 2525 | + return; |
| 2526 | + |
| 2527 | + var events = jQuery.data(elem, "events"), ret, index; |
| 2528 | + |
| 2529 | + if ( events ) { |
| 2530 | + // Unbind all events for the element |
| 2531 | + if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) |
| 2532 | + for ( var type in events ) |
| 2533 | + this.remove( elem, type + (types || "") ); |
| 2534 | + else { |
| 2535 | + // types is actually an event object here |
| 2536 | + if ( types.type ) { |
| 2537 | + handler = types.handler; |
| 2538 | + types = types.type; |
| 2539 | + } |
| 2540 | + |
| 2541 | + // Handle multiple events seperated by a space |
| 2542 | + // jQuery(...).unbind("mouseover mouseout", fn); |
| 2543 | + jQuery.each(types.split(/\s+/), function(index, type){ |
| 2544 | + // Namespaced event handlers |
| 2545 | + var namespaces = type.split("."); |
| 2546 | + type = namespaces.shift(); |
| 2547 | + var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); |
| 2548 | + |
| 2549 | + if ( events[type] ) { |
| 2550 | + // remove the given handler for the given type |
| 2551 | + if ( handler ) |
| 2552 | + delete events[type][handler.guid]; |
| 2553 | + |
| 2554 | + // remove all handlers for the given type |
| 2555 | + else |
| 2556 | + for ( var handle in events[type] ) |
| 2557 | + // Handle the removal of namespaced events |
| 2558 | + if ( namespace.test(events[type][handle].type) ) |
| 2559 | + delete events[type][handle]; |
| 2560 | + |
| 2561 | + if ( jQuery.event.specialAll[type] ) |
| 2562 | + jQuery.event.specialAll[type].teardown.call(elem, namespaces); |
| 2563 | + |
| 2564 | + // remove generic event handler if no more handlers exist |
| 2565 | + for ( ret in events[type] ) break; |
| 2566 | + if ( !ret ) { |
| 2567 | + if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { |
| 2568 | + if (elem.removeEventListener) |
| 2569 | + elem.removeEventListener(type, jQuery.data(elem, "handle"), false); |
| 2570 | + else if (elem.detachEvent) |
| 2571 | + elem.detachEvent("on" + type, jQuery.data(elem, "handle")); |
| 2572 | + } |
| 2573 | + ret = null; |
| 2574 | + delete events[type]; |
| 2575 | + } |
| 2576 | + } |
| 2577 | + }); |
| 2578 | + } |
| 2579 | + |
| 2580 | + // Remove the expando if it's no longer used |
| 2581 | + for ( ret in events ) break; |
| 2582 | + if ( !ret ) { |
| 2583 | + var handle = jQuery.data( elem, "handle" ); |
| 2584 | + if ( handle ) handle.elem = null; |
| 2585 | + jQuery.removeData( elem, "events" ); |
| 2586 | + jQuery.removeData( elem, "handle" ); |
| 2587 | + } |
| 2588 | + } |
| 2589 | + }, |
| 2590 | + |
| 2591 | + // bubbling is internal |
| 2592 | + trigger: function( event, data, elem, bubbling ) { |
| 2593 | + // Event object or event type |
| 2594 | + var type = event.type || event; |
| 2595 | + |
| 2596 | + if( !bubbling ){ |
| 2597 | + event = typeof event === "object" ? |
| 2598 | + // jQuery.Event object |
| 2599 | + event[expando] ? event : |
| 2600 | + // Object literal |
| 2601 | + jQuery.extend( jQuery.Event(type), event ) : |
| 2602 | + // Just the event type (string) |
| 2603 | + jQuery.Event(type); |
| 2604 | + |
| 2605 | + if ( type.indexOf("!") >= 0 ) { |
| 2606 | + event.type = type = type.slice(0, -1); |
| 2607 | + event.exclusive = true; |
| 2608 | + } |
| 2609 | + |
| 2610 | + // Handle a global trigger |
| 2611 | + if ( !elem ) { |
| 2612 | + // Don't bubble custom events when global (to avoid too much overhead) |
| 2613 | + event.stopPropagation(); |
| 2614 | + // Only trigger if we've ever bound an event for it |
| 2615 | + if ( this.global[type] ) |
| 2616 | + jQuery.each( jQuery.cache, function(){ |
| 2617 | + if ( this.events && this.events[type] ) |
| 2618 | + jQuery.event.trigger( event, data, this.handle.elem ); |
| 2619 | + }); |
| 2620 | + } |
| 2621 | + |
| 2622 | + // Handle triggering a single element |
| 2623 | + |
| 2624 | + // don't do events on text and comment nodes |
| 2625 | + if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) |
| 2626 | + return undefined; |
| 2627 | + |
| 2628 | + // Clean up in case it is reused |
| 2629 | + event.result = undefined; |
| 2630 | + event.target = elem; |
| 2631 | + |
| 2632 | + // Clone the incoming data, if any |
| 2633 | + data = jQuery.makeArray(data); |
| 2634 | + data.unshift( event ); |
| 2635 | + } |
| 2636 | + |
| 2637 | + event.currentTarget = elem; |
| 2638 | + |
| 2639 | + // Trigger the event, it is assumed that "handle" is a function |
| 2640 | + var handle = jQuery.data(elem, "handle"); |
| 2641 | + if ( handle ) |
| 2642 | + handle.apply( elem, data ); |
| 2643 | + |
| 2644 | + // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) |
| 2645 | + if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) |
| 2646 | + event.result = false; |
| 2647 | + |
| 2648 | + // Trigger the native events (except for clicks on links) |
| 2649 | + if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { |
| 2650 | + this.triggered = true; |
| 2651 | + try { |
| 2652 | + elem[ type ](); |
| 2653 | + // prevent IE from throwing an error for some hidden elements |
| 2654 | + } catch (e) {} |
| 2655 | + } |
| 2656 | + |
| 2657 | + this.triggered = false; |
| 2658 | + |
| 2659 | + if ( !event.isPropagationStopped() ) { |
| 2660 | + var parent = elem.parentNode || elem.ownerDocument; |
| 2661 | + if ( parent ) |
| 2662 | + jQuery.event.trigger(event, data, parent, true); |
| 2663 | + } |
| 2664 | + }, |
| 2665 | + |
| 2666 | + handle: function(event) { |
| 2667 | + // returned undefined or false |
| 2668 | + var all, handlers; |
| 2669 | + |
| 2670 | + event = arguments[0] = jQuery.event.fix( event || window.event ); |
| 2671 | + event.currentTarget = this; |
| 2672 | + |
| 2673 | + // Namespaced event handlers |
| 2674 | + var namespaces = event.type.split("."); |
| 2675 | + event.type = namespaces.shift(); |
| 2676 | + |
| 2677 | + // Cache this now, all = true means, any handler |
| 2678 | + all = !namespaces.length && !event.exclusive; |
| 2679 | + |
| 2680 | + var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); |
| 2681 | + |
| 2682 | + handlers = ( jQuery.data(this, "events") || {} )[event.type]; |
| 2683 | + |
| 2684 | + for ( var j in handlers ) { |
| 2685 | + var handler = handlers[j]; |
| 2686 | + |
| 2687 | + // Filter the functions by class |
| 2688 | + if ( all || namespace.test(handler.type) ) { |
| 2689 | + // Pass in a reference to the handler function itself |
| 2690 | + // So that we can later remove it |
| 2691 | + event.handler = handler; |
| 2692 | + event.data = handler.data; |
| 2693 | + |
| 2694 | + var ret = handler.apply(this, arguments); |
| 2695 | + |
| 2696 | + if( ret !== undefined ){ |
| 2697 | + event.result = ret; |
| 2698 | + if ( ret === false ) { |
| 2699 | + event.preventDefault(); |
| 2700 | + event.stopPropagation(); |
| 2701 | + } |
| 2702 | + } |
| 2703 | + |
| 2704 | + if( event.isImmediatePropagationStopped() ) |
| 2705 | + break; |
| 2706 | + |
| 2707 | + } |
| 2708 | + } |
| 2709 | + }, |
| 2710 | + |
| 2711 | + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), |
| 2712 | + |
| 2713 | + fix: function(event) { |
| 2714 | + if ( event[expando] ) |
| 2715 | + return event; |
| 2716 | + |
| 2717 | + // store a copy of the original event object |
| 2718 | + // and "clone" to set read-only properties |
| 2719 | + var originalEvent = event; |
| 2720 | + event = jQuery.Event( originalEvent ); |
| 2721 | + |
| 2722 | + for ( var i = this.props.length, prop; i; ){ |
| 2723 | + prop = this.props[ --i ]; |
| 2724 | + event[ prop ] = originalEvent[ prop ]; |
| 2725 | + } |
| 2726 | + |
| 2727 | + // Fix target property, if necessary |
| 2728 | + if ( !event.target ) |
| 2729 | + event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either |
| 2730 | + |
| 2731 | + // check if target is a textnode (safari) |
| 2732 | + if ( event.target.nodeType == 3 ) |
| 2733 | + event.target = event.target.parentNode; |
| 2734 | + |
| 2735 | + // Add relatedTarget, if necessary |
| 2736 | + if ( !event.relatedTarget && event.fromElement ) |
| 2737 | + event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; |
| 2738 | + |
| 2739 | + // Calculate pageX/Y if missing and clientX/Y available |
| 2740 | + if ( event.pageX == null && event.clientX != null ) { |
| 2741 | + var doc = document.documentElement, body = document.body; |
| 2742 | + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); |
| 2743 | + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); |
| 2744 | + } |
| 2745 | + |
| 2746 | + // Add which for key events |
| 2747 | + if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) |
| 2748 | + event.which = event.charCode || event.keyCode; |
| 2749 | + |
| 2750 | + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
| 2751 | + if ( !event.metaKey && event.ctrlKey ) |
| 2752 | + event.metaKey = event.ctrlKey; |
| 2753 | + |
| 2754 | + // Add which for click: 1 == left; 2 == middle; 3 == right |
| 2755 | + // Note: button is not normalized, so don't use it |
| 2756 | + if ( !event.which && event.button ) |
| 2757 | + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
| 2758 | + |
| 2759 | + return event; |
| 2760 | + }, |
| 2761 | + |
| 2762 | + proxy: function( fn, proxy ){ |
| 2763 | + proxy = proxy || function(){ return fn.apply(this, arguments); }; |
| 2764 | + // Set the guid of unique handler to the same of original handler, so it can be removed |
| 2765 | + proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; |
| 2766 | + // So proxy can be declared as an argument |
| 2767 | + return proxy; |
| 2768 | + }, |
| 2769 | + |
| 2770 | + special: { |
| 2771 | + ready: { |
| 2772 | + // Make sure the ready event is setup |
| 2773 | + setup: bindReady, |
| 2774 | + teardown: function() {} |
| 2775 | + } |
| 2776 | + }, |
| 2777 | + |
| 2778 | + specialAll: { |
| 2779 | + live: { |
| 2780 | + setup: function( selector, namespaces ){ |
| 2781 | + jQuery.event.add( this, namespaces[0], liveHandler ); |
| 2782 | + }, |
| 2783 | + teardown: function( namespaces ){ |
| 2784 | + if ( namespaces.length ) { |
| 2785 | + var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); |
| 2786 | + |
| 2787 | + jQuery.each( (jQuery.data(this, "events").live || {}), function(){ |
| 2788 | + if ( name.test(this.type) ) |
| 2789 | + remove++; |
| 2790 | + }); |
| 2791 | + |
| 2792 | + if ( remove < 1 ) |
| 2793 | + jQuery.event.remove( this, namespaces[0], liveHandler ); |
| 2794 | + } |
| 2795 | + } |
| 2796 | + } |
| 2797 | + } |
| 2798 | +}; |
| 2799 | + |
| 2800 | +jQuery.Event = function( src ){ |
| 2801 | + // Allow instantiation without the 'new' keyword |
| 2802 | + if( !this.preventDefault ) |
| 2803 | + return new jQuery.Event(src); |
| 2804 | + |
| 2805 | + // Event object |
| 2806 | + if( src && src.type ){ |
| 2807 | + this.originalEvent = src; |
| 2808 | + this.type = src.type; |
| 2809 | + // Event type |
| 2810 | + }else |
| 2811 | + this.type = src; |
| 2812 | + |
| 2813 | + // timeStamp is buggy for some events on Firefox(#3843) |
| 2814 | + // So we won't rely on the native value |
| 2815 | + this.timeStamp = now(); |
| 2816 | + |
| 2817 | + // Mark it as fixed |
| 2818 | + this[expando] = true; |
| 2819 | +}; |
| 2820 | + |
| 2821 | +function returnFalse(){ |
| 2822 | + return false; |
| 2823 | +} |
| 2824 | +function returnTrue(){ |
| 2825 | + return true; |
| 2826 | +} |
| 2827 | + |
| 2828 | +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding |
| 2829 | +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html |
| 2830 | +jQuery.Event.prototype = { |
| 2831 | + preventDefault: function() { |
| 2832 | + this.isDefaultPrevented = returnTrue; |
| 2833 | + |
| 2834 | + var e = this.originalEvent; |
| 2835 | + if( !e ) |
| 2836 | + return; |
| 2837 | + // if preventDefault exists run it on the original event |
| 2838 | + if (e.preventDefault) |
| 2839 | + e.preventDefault(); |
| 2840 | + // otherwise set the returnValue property of the original event to false (IE) |
| 2841 | + e.returnValue = false; |
| 2842 | + }, |
| 2843 | + stopPropagation: function() { |
| 2844 | + this.isPropagationStopped = returnTrue; |
| 2845 | + |
| 2846 | + var e = this.originalEvent; |
| 2847 | + if( !e ) |
| 2848 | + return; |
| 2849 | + // if stopPropagation exists run it on the original event |
| 2850 | + if (e.stopPropagation) |
| 2851 | + e.stopPropagation(); |
| 2852 | + // otherwise set the cancelBubble property of the original event to true (IE) |
| 2853 | + e.cancelBubble = true; |
| 2854 | + }, |
| 2855 | + stopImmediatePropagation:function(){ |
| 2856 | + this.isImmediatePropagationStopped = returnTrue; |
| 2857 | + this.stopPropagation(); |
| 2858 | + }, |
| 2859 | + isDefaultPrevented: returnFalse, |
| 2860 | + isPropagationStopped: returnFalse, |
| 2861 | + isImmediatePropagationStopped: returnFalse |
| 2862 | +}; |
| 2863 | +// Checks if an event happened on an element within another element |
| 2864 | +// Used in jQuery.event.special.mouseenter and mouseleave handlers |
| 2865 | +var withinElement = function(event) { |
| 2866 | + // Check if mouse(over|out) are still within the same parent element |
| 2867 | + var parent = event.relatedTarget; |
| 2868 | + // Traverse up the tree |
| 2869 | + while ( parent && parent != this ) |
| 2870 | + try { parent = parent.parentNode; } |
| 2871 | + catch(e) { parent = this; } |
| 2872 | + |
| 2873 | + if( parent != this ){ |
| 2874 | + // set the correct event type |
| 2875 | + event.type = event.data; |
| 2876 | + // handle event if we actually just moused on to a non sub-element |
| 2877 | + jQuery.event.handle.apply( this, arguments ); |
| 2878 | + } |
| 2879 | +}; |
| 2880 | + |
| 2881 | +jQuery.each({ |
| 2882 | + mouseover: 'mouseenter', |
| 2883 | + mouseout: 'mouseleave' |
| 2884 | +}, function( orig, fix ){ |
| 2885 | + jQuery.event.special[ fix ] = { |
| 2886 | + setup: function(){ |
| 2887 | + jQuery.event.add( this, orig, withinElement, fix ); |
| 2888 | + }, |
| 2889 | + teardown: function(){ |
| 2890 | + jQuery.event.remove( this, orig, withinElement ); |
| 2891 | + } |
| 2892 | + }; |
| 2893 | +}); |
| 2894 | + |
| 2895 | +jQuery.fn.extend({ |
| 2896 | + bind: function( type, data, fn ) { |
| 2897 | + return type == "unload" ? this.one(type, data, fn) : this.each(function(){ |
| 2898 | + jQuery.event.add( this, type, fn || data, fn && data ); |
| 2899 | + }); |
| 2900 | + }, |
| 2901 | + |
| 2902 | + one: function( type, data, fn ) { |
| 2903 | + var one = jQuery.event.proxy( fn || data, function(event) { |
| 2904 | + jQuery(this).unbind(event, one); |
| 2905 | + return (fn || data).apply( this, arguments ); |
| 2906 | + }); |
| 2907 | + return this.each(function(){ |
| 2908 | + jQuery.event.add( this, type, one, fn && data); |
| 2909 | + }); |
| 2910 | + }, |
| 2911 | + |
| 2912 | + unbind: function( type, fn ) { |
| 2913 | + return this.each(function(){ |
| 2914 | + jQuery.event.remove( this, type, fn ); |
| 2915 | + }); |
| 2916 | + }, |
| 2917 | + |
| 2918 | + trigger: function( type, data ) { |
| 2919 | + return this.each(function(){ |
| 2920 | + jQuery.event.trigger( type, data, this ); |
| 2921 | + }); |
| 2922 | + }, |
| 2923 | + |
| 2924 | + triggerHandler: function( type, data ) { |
| 2925 | + if( this[0] ){ |
| 2926 | + var event = jQuery.Event(type); |
| 2927 | + event.preventDefault(); |
| 2928 | + event.stopPropagation(); |
| 2929 | + jQuery.event.trigger( event, data, this[0] ); |
| 2930 | + return event.result; |
| 2931 | + } |
| 2932 | + }, |
| 2933 | + |
| 2934 | + toggle: function( fn ) { |
| 2935 | + // Save reference to arguments for access in closure |
| 2936 | + var args = arguments, i = 1; |
| 2937 | + |
| 2938 | + // link all the functions, so any of them can unbind this click handler |
| 2939 | + while( i < args.length ) |
| 2940 | + jQuery.event.proxy( fn, args[i++] ); |
| 2941 | + |
| 2942 | + return this.click( jQuery.event.proxy( fn, function(event) { |
| 2943 | + // Figure out which function to execute |
| 2944 | + this.lastToggle = ( this.lastToggle || 0 ) % i; |
| 2945 | + |
| 2946 | + // Make sure that clicks stop |
| 2947 | + event.preventDefault(); |
| 2948 | + |
| 2949 | + // and execute the function |
| 2950 | + return args[ this.lastToggle++ ].apply( this, arguments ) || false; |
| 2951 | + })); |
| 2952 | + }, |
| 2953 | + |
| 2954 | + hover: function(fnOver, fnOut) { |
| 2955 | + return this.mouseenter(fnOver).mouseleave(fnOut); |
| 2956 | + }, |
| 2957 | + |
| 2958 | + ready: function(fn) { |
| 2959 | + // Attach the listeners |
| 2960 | + bindReady(); |
| 2961 | + |
| 2962 | + // If the DOM is already ready |
| 2963 | + if ( jQuery.isReady ) |
| 2964 | + // Execute the function immediately |
| 2965 | + fn.call( document, jQuery ); |
| 2966 | + |
| 2967 | + // Otherwise, remember the function for later |
| 2968 | + else |
| 2969 | + // Add the function to the wait list |
| 2970 | + jQuery.readyList.push( fn ); |
| 2971 | + |
| 2972 | + return this; |
| 2973 | + }, |
| 2974 | + |
| 2975 | + live: function( type, fn ){ |
| 2976 | + var proxy = jQuery.event.proxy( fn ); |
| 2977 | + proxy.guid += this.selector + type; |
| 2978 | + |
| 2979 | + jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); |
| 2980 | + |
| 2981 | + return this; |
| 2982 | + }, |
| 2983 | + |
| 2984 | + die: function( type, fn ){ |
| 2985 | + jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); |
| 2986 | + return this; |
| 2987 | + } |
| 2988 | +}); |
| 2989 | + |
| 2990 | +function liveHandler( event ){ |
| 2991 | + var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), |
| 2992 | + stop = true, |
| 2993 | + elems = []; |
| 2994 | + |
| 2995 | + jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ |
| 2996 | + if ( check.test(fn.type) ) { |
| 2997 | + var elem = jQuery(event.target).closest(fn.data)[0]; |
| 2998 | + if ( elem ) |
| 2999 | + elems.push({ elem: elem, fn: fn }); |
| 3000 | + } |
| 3001 | + }); |
| 3002 | + |
| 3003 | + elems.sort(function(a,b) { |
| 3004 | + return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); |
| 3005 | + }); |
| 3006 | + |
| 3007 | + jQuery.each(elems, function(){ |
| 3008 | + if ( this.fn.call(this.elem, event, this.fn.data) === false ) |
| 3009 | + return (stop = false); |
| 3010 | + }); |
| 3011 | + |
| 3012 | + return stop; |
| 3013 | +} |
| 3014 | + |
| 3015 | +function liveConvert(type, selector){ |
| 3016 | + return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); |
| 3017 | +} |
| 3018 | + |
| 3019 | +jQuery.extend({ |
| 3020 | + isReady: false, |
| 3021 | + readyList: [], |
| 3022 | + // Handle when the DOM is ready |
| 3023 | + ready: function() { |
| 3024 | + // Make sure that the DOM is not already loaded |
| 3025 | + if ( !jQuery.isReady ) { |
| 3026 | + // Remember that the DOM is ready |
| 3027 | + jQuery.isReady = true; |
| 3028 | + |
| 3029 | + // If there are functions bound, to execute |
| 3030 | + if ( jQuery.readyList ) { |
| 3031 | + // Execute all of them |
| 3032 | + jQuery.each( jQuery.readyList, function(){ |
| 3033 | + this.call( document, jQuery ); |
| 3034 | + }); |
| 3035 | + |
| 3036 | + // Reset the list of functions |
| 3037 | + jQuery.readyList = null; |
| 3038 | + } |
| 3039 | + |
| 3040 | + // Trigger any bound ready events |
| 3041 | + jQuery(document).triggerHandler("ready"); |
| 3042 | + } |
| 3043 | + } |
| 3044 | +}); |
| 3045 | + |
| 3046 | +var readyBound = false; |
| 3047 | + |
| 3048 | +function bindReady(){ |
| 3049 | + if ( readyBound ) return; |
| 3050 | + readyBound = true; |
| 3051 | + |
| 3052 | + // Mozilla, Opera and webkit nightlies currently support this event |
| 3053 | + if ( document.addEventListener ) { |
| 3054 | + // Use the handy event callback |
| 3055 | + document.addEventListener( "DOMContentLoaded", function(){ |
| 3056 | + document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); |
| 3057 | + jQuery.ready(); |
| 3058 | + }, false ); |
| 3059 | + |
| 3060 | + // If IE event model is used |
| 3061 | + } else if ( document.attachEvent ) { |
| 3062 | + // ensure firing before onload, |
| 3063 | + // maybe late but safe also for iframes |
| 3064 | + document.attachEvent("onreadystatechange", function(){ |
| 3065 | + if ( document.readyState === "complete" ) { |
| 3066 | + document.detachEvent( "onreadystatechange", arguments.callee ); |
| 3067 | + jQuery.ready(); |
| 3068 | + } |
| 3069 | + }); |
| 3070 | + |
| 3071 | + // If IE and not an iframe |
| 3072 | + // continually check to see if the document is ready |
| 3073 | + if ( document.documentElement.doScroll && window == window.top ) (function(){ |
| 3074 | + if ( jQuery.isReady ) return; |
| 3075 | + |
| 3076 | + try { |
| 3077 | + // If IE is used, use the trick by Diego Perini |
| 3078 | + // http://javascript.nwbox.com/IEContentLoaded/ |
| 3079 | + document.documentElement.doScroll("left"); |
| 3080 | + } catch( error ) { |
| 3081 | + setTimeout( arguments.callee, 0 ); |
| 3082 | + return; |
| 3083 | + } |
| 3084 | + |
| 3085 | + // and execute any waiting functions |
| 3086 | + jQuery.ready(); |
| 3087 | + })(); |
| 3088 | + } |
| 3089 | + |
| 3090 | + // A fallback to window.onload, that will always work |
| 3091 | + jQuery.event.add( window, "load", jQuery.ready ); |
| 3092 | +} |
| 3093 | + |
| 3094 | +jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + |
| 3095 | + "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + |
| 3096 | + "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ |
| 3097 | + |
| 3098 | + // Handle event binding |
| 3099 | + jQuery.fn[name] = function(fn){ |
| 3100 | + return fn ? this.bind(name, fn) : this.trigger(name); |
| 3101 | + }; |
| 3102 | +}); |
| 3103 | + |
| 3104 | +// Prevent memory leaks in IE |
| 3105 | +// And prevent errors on refresh with events like mouseover in other browsers |
| 3106 | +// Window isn't included so as not to unbind existing unload events |
| 3107 | +jQuery( window ).bind( 'unload', function(){ |
| 3108 | + for ( var id in jQuery.cache ) |
| 3109 | + // Skip the window |
| 3110 | + if ( id != 1 && jQuery.cache[ id ].handle ) |
| 3111 | + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); |
| 3112 | +}); |
| 3113 | +(function(){ |
| 3114 | + |
| 3115 | + jQuery.support = {}; |
| 3116 | + |
| 3117 | + var root = document.documentElement, |
| 3118 | + script = document.createElement("script"), |
| 3119 | + div = document.createElement("div"), |
| 3120 | + id = "script" + (new Date).getTime(); |
| 3121 | + |
| 3122 | + div.style.display = "none"; |
| 3123 | + div.innerHTML = ' <link/><table></table><a href="https://www.mediawiki.org/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; |
| 3124 | + |
| 3125 | + var all = div.getElementsByTagName("*"), |
| 3126 | + a = div.getElementsByTagName("a")[0]; |
| 3127 | + |
| 3128 | + // Can't get basic test support |
| 3129 | + if ( !all || !all.length || !a ) { |
| 3130 | + return; |
| 3131 | + } |
| 3132 | + |
| 3133 | + jQuery.support = { |
| 3134 | + // IE strips leading whitespace when .innerHTML is used |
| 3135 | + leadingWhitespace: div.firstChild.nodeType == 3, |
| 3136 | + |
| 3137 | + // Make sure that tbody elements aren't automatically inserted |
| 3138 | + // IE will insert them into empty tables |
| 3139 | + tbody: !div.getElementsByTagName("tbody").length, |
| 3140 | + |
| 3141 | + // Make sure that you can get all elements in an <object> element |
| 3142 | + // IE 7 always returns no results |
| 3143 | + objectAll: !!div.getElementsByTagName("object")[0] |
| 3144 | + .getElementsByTagName("*").length, |
| 3145 | + |
| 3146 | + // Make sure that link elements get serialized correctly by innerHTML |
| 3147 | + // This requires a wrapper element in IE |
| 3148 | + htmlSerialize: !!div.getElementsByTagName("link").length, |
| 3149 | + |
| 3150 | + // Get the style information from getAttribute |
| 3151 | + // (IE uses .cssText insted) |
| 3152 | + style: /red/.test( a.getAttribute("style") ), |
| 3153 | + |
| 3154 | + // Make sure that URLs aren't manipulated |
| 3155 | + // (IE normalizes it by default) |
| 3156 | + hrefNormalized: a.getAttribute("href") === "/a", |
| 3157 | + |
| 3158 | + // Make sure that element opacity exists |
| 3159 | + // (IE uses filter instead) |
| 3160 | + opacity: a.style.opacity === "0.5", |
| 3161 | + |
| 3162 | + // Verify style float existence |
| 3163 | + // (IE uses styleFloat instead of cssFloat) |
| 3164 | + cssFloat: !!a.style.cssFloat, |
| 3165 | + |
| 3166 | + // Will be defined later |
| 3167 | + scriptEval: false, |
| 3168 | + noCloneEvent: true, |
| 3169 | + boxModel: null |
| 3170 | + }; |
| 3171 | + |
| 3172 | + script.type = "text/javascript"; |
| 3173 | + try { |
| 3174 | + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); |
| 3175 | + } catch(e){} |
| 3176 | + |
| 3177 | + root.insertBefore( script, root.firstChild ); |
| 3178 | + |
| 3179 | + // Make sure that the execution of code works by injecting a script |
| 3180 | + // tag with appendChild/createTextNode |
| 3181 | + // (IE doesn't support this, fails, and uses .text instead) |
| 3182 | + if ( window[ id ] ) { |
| 3183 | + jQuery.support.scriptEval = true; |
| 3184 | + delete window[ id ]; |
| 3185 | + } |
| 3186 | + |
| 3187 | + root.removeChild( script ); |
| 3188 | + |
| 3189 | + if ( div.attachEvent && div.fireEvent ) { |
| 3190 | + div.attachEvent("onclick", function(){ |
| 3191 | + // Cloning a node shouldn't copy over any |
| 3192 | + // bound event handlers (IE does this) |
| 3193 | + jQuery.support.noCloneEvent = false; |
| 3194 | + div.detachEvent("onclick", arguments.callee); |
| 3195 | + }); |
| 3196 | + div.cloneNode(true).fireEvent("onclick"); |
| 3197 | + } |
| 3198 | + |
| 3199 | + // Figure out if the W3C box model works as expected |
| 3200 | + // document.body must exist before we can do this |
| 3201 | + jQuery(function(){ |
| 3202 | + var div = document.createElement("div"); |
| 3203 | + div.style.width = div.style.paddingLeft = "1px"; |
| 3204 | + |
| 3205 | + document.body.appendChild( div ); |
| 3206 | + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; |
| 3207 | + document.body.removeChild( div ).style.display = 'none'; |
| 3208 | + }); |
| 3209 | +})(); |
| 3210 | + |
| 3211 | +var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; |
| 3212 | + |
| 3213 | +jQuery.props = { |
| 3214 | + "for": "htmlFor", |
| 3215 | + "class": "className", |
| 3216 | + "float": styleFloat, |
| 3217 | + cssFloat: styleFloat, |
| 3218 | + styleFloat: styleFloat, |
| 3219 | + readonly: "readOnly", |
| 3220 | + maxlength: "maxLength", |
| 3221 | + cellspacing: "cellSpacing", |
| 3222 | + rowspan: "rowSpan", |
| 3223 | + tabindex: "tabIndex" |
| 3224 | +}; |
| 3225 | +jQuery.fn.extend({ |
| 3226 | + // Keep a copy of the old load |
| 3227 | + _load: jQuery.fn.load, |
| 3228 | + |
| 3229 | + load: function( url, params, callback ) { |
| 3230 | + if ( typeof url !== "string" ) |
| 3231 | + return this._load( url ); |
| 3232 | + |
| 3233 | + var off = url.indexOf(" "); |
| 3234 | + if ( off >= 0 ) { |
| 3235 | + var selector = url.slice(off, url.length); |
| 3236 | + url = url.slice(0, off); |
| 3237 | + } |
| 3238 | + |
| 3239 | + // Default to a GET request |
| 3240 | + var type = "GET"; |
| 3241 | + |
| 3242 | + // If the second parameter was provided |
| 3243 | + if ( params ) |
| 3244 | + // If it's a function |
| 3245 | + if ( jQuery.isFunction( params ) ) { |
| 3246 | + // We assume that it's the callback |
| 3247 | + callback = params; |
| 3248 | + params = null; |
| 3249 | + |
| 3250 | + // Otherwise, build a param string |
| 3251 | + } else if( typeof params === "object" ) { |
| 3252 | + params = jQuery.param( params ); |
| 3253 | + type = "POST"; |
| 3254 | + } |
| 3255 | + |
| 3256 | + var self = this; |
| 3257 | + |
| 3258 | + // Request the remote document |
| 3259 | + jQuery.ajax({ |
| 3260 | + url: url, |
| 3261 | + type: type, |
| 3262 | + dataType: "html", |
| 3263 | + data: params, |
| 3264 | + complete: function(res, status){ |
| 3265 | + // If successful, inject the HTML into all the matched elements |
| 3266 | + if ( status == "success" || status == "notmodified" ) |
| 3267 | + // See if a selector was specified |
| 3268 | + self.html( selector ? |
| 3269 | + // Create a dummy div to hold the results |
| 3270 | + jQuery("<div/>") |
| 3271 | + // inject the contents of the document in, removing the scripts |
| 3272 | + // to avoid any 'Permission Denied' errors in IE |
| 3273 | + .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) |
| 3274 | + |
| 3275 | + // Locate the specified elements |
| 3276 | + .find(selector) : |
| 3277 | + |
| 3278 | + // If not, just inject the full result |
| 3279 | + res.responseText ); |
| 3280 | + |
| 3281 | + if( callback ) |
| 3282 | + self.each( callback, [res.responseText, status, res] ); |
| 3283 | + } |
| 3284 | + }); |
| 3285 | + return this; |
| 3286 | + }, |
| 3287 | + |
| 3288 | + serialize: function() { |
| 3289 | + return jQuery.param(this.serializeArray()); |
| 3290 | + }, |
| 3291 | + serializeArray: function() { |
| 3292 | + return this.map(function(){ |
| 3293 | + return this.elements ? jQuery.makeArray(this.elements) : this; |
| 3294 | + }) |
| 3295 | + .filter(function(){ |
| 3296 | + return this.name && !this.disabled && |
| 3297 | + (this.checked || /select|textarea/i.test(this.nodeName) || |
| 3298 | + /text|hidden|password|search/i.test(this.type)); |
| 3299 | + }) |
| 3300 | + .map(function(i, elem){ |
| 3301 | + var val = jQuery(this).val(); |
| 3302 | + return val == null ? null : |
| 3303 | + jQuery.isArray(val) ? |
| 3304 | + jQuery.map( val, function(val, i){ |
| 3305 | + return {name: elem.name, value: val}; |
| 3306 | + }) : |
| 3307 | + {name: elem.name, value: val}; |
| 3308 | + }).get(); |
| 3309 | + } |
| 3310 | +}); |
| 3311 | + |
| 3312 | +// Attach a bunch of functions for handling common AJAX events |
| 3313 | +jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ |
| 3314 | + jQuery.fn[o] = function(f){ |
| 3315 | + return this.bind(o, f); |
| 3316 | + }; |
| 3317 | +}); |
| 3318 | + |
| 3319 | +var jsc = now(); |
| 3320 | + |
| 3321 | +jQuery.extend({ |
| 3322 | + |
| 3323 | + get: function( url, data, callback, type ) { |
| 3324 | + // shift arguments if data argument was ommited |
| 3325 | + if ( jQuery.isFunction( data ) ) { |
| 3326 | + callback = data; |
| 3327 | + data = null; |
| 3328 | + } |
| 3329 | + |
| 3330 | + return jQuery.ajax({ |
| 3331 | + type: "GET", |
| 3332 | + url: url, |
| 3333 | + data: data, |
| 3334 | + success: callback, |
| 3335 | + dataType: type |
| 3336 | + }); |
| 3337 | + }, |
| 3338 | + |
| 3339 | + getScript: function( url, callback ) { |
| 3340 | + return jQuery.get(url, null, callback, "script"); |
| 3341 | + }, |
| 3342 | + |
| 3343 | + getJSON: function( url, data, callback ) { |
| 3344 | + return jQuery.get(url, data, callback, "json"); |
| 3345 | + }, |
| 3346 | + |
| 3347 | + post: function( url, data, callback, type ) { |
| 3348 | + if ( jQuery.isFunction( data ) ) { |
| 3349 | + callback = data; |
| 3350 | + data = {}; |
| 3351 | + } |
| 3352 | + |
| 3353 | + return jQuery.ajax({ |
| 3354 | + type: "POST", |
| 3355 | + url: url, |
| 3356 | + data: data, |
| 3357 | + success: callback, |
| 3358 | + dataType: type |
| 3359 | + }); |
| 3360 | + }, |
| 3361 | + |
| 3362 | + ajaxSetup: function( settings ) { |
| 3363 | + jQuery.extend( jQuery.ajaxSettings, settings ); |
| 3364 | + }, |
| 3365 | + |
| 3366 | + ajaxSettings: { |
| 3367 | + url: location.href, |
| 3368 | + global: true, |
| 3369 | + type: "GET", |
| 3370 | + contentType: "application/x-www-form-urlencoded", |
| 3371 | + processData: true, |
| 3372 | + async: true, |
| 3373 | + /* |
| 3374 | + timeout: 0, |
| 3375 | + data: null, |
| 3376 | + username: null, |
| 3377 | + password: null, |
| 3378 | + */ |
| 3379 | + // Create the request object; Microsoft failed to properly |
| 3380 | + // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available |
| 3381 | + // This function can be overriden by calling jQuery.ajaxSetup |
| 3382 | + xhr:function(){ |
| 3383 | + return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); |
| 3384 | + }, |
| 3385 | + accepts: { |
| 3386 | + xml: "application/xml, text/xml", |
| 3387 | + html: "text/html", |
| 3388 | + script: "text/javascript, application/javascript", |
| 3389 | + json: "application/json, text/javascript", |
| 3390 | + text: "text/plain", |
| 3391 | + _default: "*/*" |
| 3392 | + } |
| 3393 | + }, |
| 3394 | + |
| 3395 | + // Last-Modified header cache for next request |
| 3396 | + lastModified: {}, |
| 3397 | + |
| 3398 | + ajax: function( s ) { |
| 3399 | + // Extend the settings, but re-extend 's' so that it can be |
| 3400 | + // checked again later (in the test suite, specifically) |
| 3401 | + s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); |
| 3402 | + |
| 3403 | + var jsonp, jsre = /=\?(&|$)/g, status, data, |
| 3404 | + type = s.type.toUpperCase(); |
| 3405 | + |
| 3406 | + // convert data if not already a string |
| 3407 | + if ( s.data && s.processData && typeof s.data !== "string" ) |
| 3408 | + s.data = jQuery.param(s.data); |
| 3409 | + |
| 3410 | + // Handle JSONP Parameter Callbacks |
| 3411 | + if ( s.dataType == "jsonp" ) { |
| 3412 | + if ( type == "GET" ) { |
| 3413 | + if ( !s.url.match(jsre) ) |
| 3414 | + s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; |
| 3415 | + } else if ( !s.data || !s.data.match(jsre) ) |
| 3416 | + s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; |
| 3417 | + s.dataType = "json"; |
| 3418 | + } |
| 3419 | + |
| 3420 | + // Build temporary JSONP function |
| 3421 | + if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { |
| 3422 | + jsonp = "jsonp" + jsc++; |
| 3423 | + |
| 3424 | + // Replace the =? sequence both in the query string and the data |
| 3425 | + if ( s.data ) |
| 3426 | + s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); |
| 3427 | + s.url = s.url.replace(jsre, "=" + jsonp + "$1"); |
| 3428 | + |
| 3429 | + // We need to make sure |
| 3430 | + // that a JSONP style response is executed properly |
| 3431 | + s.dataType = "script"; |
| 3432 | + |
| 3433 | + // Handle JSONP-style loading |
| 3434 | + window[ jsonp ] = function(tmp){ |
| 3435 | + data = tmp; |
| 3436 | + success(); |
| 3437 | + complete(); |
| 3438 | + // Garbage collect |
| 3439 | + window[ jsonp ] = undefined; |
| 3440 | + try{ delete window[ jsonp ]; } catch(e){} |
| 3441 | + if ( head ) |
| 3442 | + head.removeChild( script ); |
| 3443 | + }; |
| 3444 | + } |
| 3445 | + |
| 3446 | + if ( s.dataType == "script" && s.cache == null ) |
| 3447 | + s.cache = false; |
| 3448 | + |
| 3449 | + if ( s.cache === false && type == "GET" ) { |
| 3450 | + var ts = now(); |
| 3451 | + // try replacing _= if it is there |
| 3452 | + var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); |
| 3453 | + // if nothing was replaced, add timestamp to the end |
| 3454 | + s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); |
| 3455 | + } |
| 3456 | + |
| 3457 | + // If data is available, append data to url for get requests |
| 3458 | + if ( s.data && type == "GET" ) { |
| 3459 | + s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; |
| 3460 | + |
| 3461 | + // IE likes to send both get and post data, prevent this |
| 3462 | + s.data = null; |
| 3463 | + } |
| 3464 | + |
| 3465 | + // Watch for a new set of requests |
| 3466 | + if ( s.global && ! jQuery.active++ ) |
| 3467 | + jQuery.event.trigger( "ajaxStart" ); |
| 3468 | + |
| 3469 | + // Matches an absolute URL, and saves the domain |
| 3470 | + var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); |
| 3471 | + |
| 3472 | + // If we're requesting a remote document |
| 3473 | + // and trying to load JSON or Script with a GET |
| 3474 | + if ( s.dataType == "script" && type == "GET" && parts |
| 3475 | + && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ |
| 3476 | + |
| 3477 | + var head = document.getElementsByTagName("head")[0]; |
| 3478 | + var script = document.createElement("script"); |
| 3479 | + script.src = s.url; |
| 3480 | + if (s.scriptCharset) |
| 3481 | + script.charset = s.scriptCharset; |
| 3482 | + |
| 3483 | + // Handle Script loading |
| 3484 | + if ( !jsonp ) { |
| 3485 | + var done = false; |
| 3486 | + |
| 3487 | + // Attach handlers for all browsers |
| 3488 | + script.onload = script.onreadystatechange = function(){ |
| 3489 | + if ( !done && (!this.readyState || |
| 3490 | + this.readyState == "loaded" || this.readyState == "complete") ) { |
| 3491 | + done = true; |
| 3492 | + success(); |
| 3493 | + complete(); |
| 3494 | + |
| 3495 | + // Handle memory leak in IE |
| 3496 | + script.onload = script.onreadystatechange = null; |
| 3497 | + head.removeChild( script ); |
| 3498 | + } |
| 3499 | + }; |
| 3500 | + } |
| 3501 | + |
| 3502 | + head.appendChild(script); |
| 3503 | + |
| 3504 | + // We handle everything using the script element injection |
| 3505 | + return undefined; |
| 3506 | + } |
| 3507 | + |
| 3508 | + var requestDone = false; |
| 3509 | + |
| 3510 | + // Create the request object |
| 3511 | + var xhr = s.xhr(); |
| 3512 | + |
| 3513 | + // Open the socket |
| 3514 | + // Passing null username, generates a login popup on Opera (#2865) |
| 3515 | + if( s.username ) |
| 3516 | + xhr.open(type, s.url, s.async, s.username, s.password); |
| 3517 | + else |
| 3518 | + xhr.open(type, s.url, s.async); |
| 3519 | + |
| 3520 | + // Need an extra try/catch for cross domain requests in Firefox 3 |
| 3521 | + try { |
| 3522 | + // Set the correct header, if data is being sent |
| 3523 | + if ( s.data ) |
| 3524 | + xhr.setRequestHeader("Content-Type", s.contentType); |
| 3525 | + |
| 3526 | + // Set the If-Modified-Since header, if ifModified mode. |
| 3527 | + if ( s.ifModified ) |
| 3528 | + xhr.setRequestHeader("If-Modified-Since", |
| 3529 | + jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); |
| 3530 | + |
| 3531 | + // Set header so the called script knows that it's an XMLHttpRequest |
| 3532 | + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
| 3533 | + |
| 3534 | + // Set the Accepts header for the server, depending on the dataType |
| 3535 | + xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? |
| 3536 | + s.accepts[ s.dataType ] + ", */*" : |
| 3537 | + s.accepts._default ); |
| 3538 | + } catch(e){} |
| 3539 | + |
| 3540 | + // Allow custom headers/mimetypes and early abort |
| 3541 | + if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { |
| 3542 | + // Handle the global AJAX counter |
| 3543 | + if ( s.global && ! --jQuery.active ) |
| 3544 | + jQuery.event.trigger( "ajaxStop" ); |
| 3545 | + // close opended socket |
| 3546 | + xhr.abort(); |
| 3547 | + return false; |
| 3548 | + } |
| 3549 | + |
| 3550 | + if ( s.global ) |
| 3551 | + jQuery.event.trigger("ajaxSend", [xhr, s]); |
| 3552 | + |
| 3553 | + // Wait for a response to come back |
| 3554 | + var onreadystatechange = function(isTimeout){ |
| 3555 | + // The request was aborted, clear the interval and decrement jQuery.active |
| 3556 | + if (xhr.readyState == 0) { |
| 3557 | + if (ival) { |
| 3558 | + // clear poll interval |
| 3559 | + clearInterval(ival); |
| 3560 | + ival = null; |
| 3561 | + // Handle the global AJAX counter |
| 3562 | + if ( s.global && ! --jQuery.active ) |
| 3563 | + jQuery.event.trigger( "ajaxStop" ); |
| 3564 | + } |
| 3565 | + // The transfer is complete and the data is available, or the request timed out |
| 3566 | + } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { |
| 3567 | + requestDone = true; |
| 3568 | + |
| 3569 | + // clear poll interval |
| 3570 | + if (ival) { |
| 3571 | + clearInterval(ival); |
| 3572 | + ival = null; |
| 3573 | + } |
| 3574 | + |
| 3575 | + status = isTimeout == "timeout" ? "timeout" : |
| 3576 | + !jQuery.httpSuccess( xhr ) ? "error" : |
| 3577 | + s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : |
| 3578 | + "success"; |
| 3579 | + |
| 3580 | + if ( status == "success" ) { |
| 3581 | + // Watch for, and catch, XML document parse errors |
| 3582 | + try { |
| 3583 | + // process the data (runs the xml through httpData regardless of callback) |
| 3584 | + data = jQuery.httpData( xhr, s.dataType, s ); |
| 3585 | + } catch(e) { |
| 3586 | + status = "parsererror"; |
| 3587 | + } |
| 3588 | + } |
| 3589 | + |
| 3590 | + // Make sure that the request was successful or notmodified |
| 3591 | + if ( status == "success" ) { |
| 3592 | + // Cache Last-Modified header, if ifModified mode. |
| 3593 | + var modRes; |
| 3594 | + try { |
| 3595 | + modRes = xhr.getResponseHeader("Last-Modified"); |
| 3596 | + } catch(e) {} // swallow exception thrown by FF if header is not available |
| 3597 | + |
| 3598 | + if ( s.ifModified && modRes ) |
| 3599 | + jQuery.lastModified[s.url] = modRes; |
| 3600 | + |
| 3601 | + // JSONP handles its own success callback |
| 3602 | + if ( !jsonp ) |
| 3603 | + success(); |
| 3604 | + } else |
| 3605 | + jQuery.handleError(s, xhr, status); |
| 3606 | + |
| 3607 | + // Fire the complete handlers |
| 3608 | + complete(); |
| 3609 | + |
| 3610 | + if ( isTimeout ) |
| 3611 | + xhr.abort(); |
| 3612 | + |
| 3613 | + // Stop memory leaks |
| 3614 | + if ( s.async ) |
| 3615 | + xhr = null; |
| 3616 | + } |
| 3617 | + }; |
| 3618 | + |
| 3619 | + if ( s.async ) { |
| 3620 | + // don't attach the handler to the request, just poll it instead |
| 3621 | + var ival = setInterval(onreadystatechange, 13); |
| 3622 | + |
| 3623 | + // Timeout checker |
| 3624 | + if ( s.timeout > 0 ) |
| 3625 | + setTimeout(function(){ |
| 3626 | + // Check to see if the request is still happening |
| 3627 | + if ( xhr && !requestDone ) |
| 3628 | + onreadystatechange( "timeout" ); |
| 3629 | + }, s.timeout); |
| 3630 | + } |
| 3631 | + |
| 3632 | + // Send the data |
| 3633 | + try { |
| 3634 | + xhr.send(s.data); |
| 3635 | + } catch(e) { |
| 3636 | + jQuery.handleError(s, xhr, null, e); |
| 3637 | + } |
| 3638 | + |
| 3639 | + // firefox 1.5 doesn't fire statechange for sync requests |
| 3640 | + if ( !s.async ) |
| 3641 | + onreadystatechange(); |
| 3642 | + |
| 3643 | + function success(){ |
| 3644 | + // If a local callback was specified, fire it and pass it the data |
| 3645 | + if ( s.success ) |
| 3646 | + s.success( data, status ); |
| 3647 | + |
| 3648 | + // Fire the global callback |
| 3649 | + if ( s.global ) |
| 3650 | + jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); |
| 3651 | + } |
| 3652 | + |
| 3653 | + function complete(){ |
| 3654 | + // Process result |
| 3655 | + if ( s.complete ) |
| 3656 | + s.complete(xhr, status); |
| 3657 | + |
| 3658 | + // The request was completed |
| 3659 | + if ( s.global ) |
| 3660 | + jQuery.event.trigger( "ajaxComplete", [xhr, s] ); |
| 3661 | + |
| 3662 | + // Handle the global AJAX counter |
| 3663 | + if ( s.global && ! --jQuery.active ) |
| 3664 | + jQuery.event.trigger( "ajaxStop" ); |
| 3665 | + } |
| 3666 | + |
| 3667 | + // return XMLHttpRequest to allow aborting the request etc. |
| 3668 | + return xhr; |
| 3669 | + }, |
| 3670 | + |
| 3671 | + handleError: function( s, xhr, status, e ) { |
| 3672 | + // If a local callback was specified, fire it |
| 3673 | + if ( s.error ) s.error( xhr, status, e ); |
| 3674 | + |
| 3675 | + // Fire the global callback |
| 3676 | + if ( s.global ) |
| 3677 | + jQuery.event.trigger( "ajaxError", [xhr, s, e] ); |
| 3678 | + }, |
| 3679 | + |
| 3680 | + // Counter for holding the number of active queries |
| 3681 | + active: 0, |
| 3682 | + |
| 3683 | + // Determines if an XMLHttpRequest was successful or not |
| 3684 | + httpSuccess: function( xhr ) { |
| 3685 | + try { |
| 3686 | + // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 |
| 3687 | + return !xhr.status && location.protocol == "file:" || |
| 3688 | + ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; |
| 3689 | + } catch(e){} |
| 3690 | + return false; |
| 3691 | + }, |
| 3692 | + |
| 3693 | + // Determines if an XMLHttpRequest returns NotModified |
| 3694 | + httpNotModified: function( xhr, url ) { |
| 3695 | + try { |
| 3696 | + var xhrRes = xhr.getResponseHeader("Last-Modified"); |
| 3697 | + |
| 3698 | + // Firefox always returns 200. check Last-Modified date |
| 3699 | + return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; |
| 3700 | + } catch(e){} |
| 3701 | + return false; |
| 3702 | + }, |
| 3703 | + |
| 3704 | + httpData: function( xhr, type, s ) { |
| 3705 | + var ct = xhr.getResponseHeader("content-type"), |
| 3706 | + xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, |
| 3707 | + data = xml ? xhr.responseXML : xhr.responseText; |
| 3708 | + |
| 3709 | + if ( xml && data.documentElement.tagName == "parsererror" ) |
| 3710 | + throw "parsererror"; |
| 3711 | + |
| 3712 | + // Allow a pre-filtering function to sanitize the response |
| 3713 | + // s != null is checked to keep backwards compatibility |
| 3714 | + if( s && s.dataFilter ) |
| 3715 | + data = s.dataFilter( data, type ); |
| 3716 | + |
| 3717 | + // The filter can actually parse the response |
| 3718 | + if( typeof data === "string" ){ |
| 3719 | + |
| 3720 | + // If the type is "script", eval it in global context |
| 3721 | + if ( type == "script" ) |
| 3722 | + jQuery.globalEval( data ); |
| 3723 | + |
| 3724 | + // Get the JavaScript object, if JSON is used. |
| 3725 | + if ( type == "json" ) |
| 3726 | + data = window["eval"]("(" + data + ")"); |
| 3727 | + } |
| 3728 | + |
| 3729 | + return data; |
| 3730 | + }, |
| 3731 | + |
| 3732 | + // Serialize an array of form elements or a set of |
| 3733 | + // key/values into a query string |
| 3734 | + param: function( a ) { |
| 3735 | + var s = [ ]; |
| 3736 | + |
| 3737 | + function add( key, value ){ |
| 3738 | + s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); |
| 3739 | + }; |
| 3740 | + |
| 3741 | + // If an array was passed in, assume that it is an array |
| 3742 | + // of form elements |
| 3743 | + if ( jQuery.isArray(a) || a.jquery ) |
| 3744 | + // Serialize the form elements |
| 3745 | + jQuery.each( a, function(){ |
| 3746 | + add( this.name, this.value ); |
| 3747 | + }); |
| 3748 | + |
| 3749 | + // Otherwise, assume that it's an object of key/value pairs |
| 3750 | + else |
| 3751 | + // Serialize the key/values |
| 3752 | + for ( var j in a ) |
| 3753 | + // If the value is an array then the key names need to be repeated |
| 3754 | + if ( jQuery.isArray(a[j]) ) |
| 3755 | + jQuery.each( a[j], function(){ |
| 3756 | + add( j, this ); |
| 3757 | + }); |
| 3758 | + else |
| 3759 | + add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); |
| 3760 | + |
| 3761 | + // Return the resulting serialization |
| 3762 | + return s.join("&").replace(/%20/g, "+"); |
| 3763 | + } |
| 3764 | + |
| 3765 | +}); |
| 3766 | +var elemdisplay = {}, |
| 3767 | + timerId, |
| 3768 | + fxAttrs = [ |
| 3769 | + // height animations |
| 3770 | + [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], |
| 3771 | + // width animations |
| 3772 | + [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], |
| 3773 | + // opacity animations |
| 3774 | + [ "opacity" ] |
| 3775 | + ]; |
| 3776 | + |
| 3777 | +function genFx( type, num ){ |
| 3778 | + var obj = {}; |
| 3779 | + jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ |
| 3780 | + obj[ this ] = type; |
| 3781 | + }); |
| 3782 | + return obj; |
| 3783 | +} |
| 3784 | + |
| 3785 | +jQuery.fn.extend({ |
| 3786 | + show: function(speed,callback){ |
| 3787 | + if ( speed ) { |
| 3788 | + return this.animate( genFx("show", 3), speed, callback); |
| 3789 | + } else { |
| 3790 | + for ( var i = 0, l = this.length; i < l; i++ ){ |
| 3791 | + var old = jQuery.data(this[i], "olddisplay"); |
| 3792 | + |
| 3793 | + this[i].style.display = old || ""; |
| 3794 | + |
| 3795 | + if ( jQuery.css(this[i], "display") === "none" ) { |
| 3796 | + var tagName = this[i].tagName, display; |
| 3797 | + |
| 3798 | + if ( elemdisplay[ tagName ] ) { |
| 3799 | + display = elemdisplay[ tagName ]; |
| 3800 | + } else { |
| 3801 | + var elem = jQuery("<" + tagName + " />").appendTo("body"); |
| 3802 | + |
| 3803 | + display = elem.css("display"); |
| 3804 | + if ( display === "none" ) |
| 3805 | + display = "block"; |
| 3806 | + |
| 3807 | + elem.remove(); |
| 3808 | + |
| 3809 | + elemdisplay[ tagName ] = display; |
| 3810 | + } |
| 3811 | + |
| 3812 | + jQuery.data(this[i], "olddisplay", display); |
| 3813 | + } |
| 3814 | + } |
| 3815 | + |
| 3816 | + // Set the display of the elements in a second loop |
| 3817 | + // to avoid the constant reflow |
| 3818 | + for ( var i = 0, l = this.length; i < l; i++ ){ |
| 3819 | + this[i].style.display = jQuery.data(this[i], "olddisplay") || ""; |
| 3820 | + } |
| 3821 | + |
| 3822 | + return this; |
| 3823 | + } |
| 3824 | + }, |
| 3825 | + |
| 3826 | + hide: function(speed,callback){ |
| 3827 | + if ( speed ) { |
| 3828 | + return this.animate( genFx("hide", 3), speed, callback); |
| 3829 | + } else { |
| 3830 | + for ( var i = 0, l = this.length; i < l; i++ ){ |
| 3831 | + var old = jQuery.data(this[i], "olddisplay"); |
| 3832 | + if ( !old && old !== "none" ) |
| 3833 | + jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); |
| 3834 | + } |
| 3835 | + |
| 3836 | + // Set the display of the elements in a second loop |
| 3837 | + // to avoid the constant reflow |
| 3838 | + for ( var i = 0, l = this.length; i < l; i++ ){ |
| 3839 | + this[i].style.display = "none"; |
| 3840 | + } |
| 3841 | + |
| 3842 | + return this; |
| 3843 | + } |
| 3844 | + }, |
| 3845 | + |
| 3846 | + // Save the old toggle function |
| 3847 | + _toggle: jQuery.fn.toggle, |
| 3848 | + |
| 3849 | + toggle: function( fn, fn2 ){ |
| 3850 | + var bool = typeof fn === "boolean"; |
| 3851 | + |
| 3852 | + return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? |
| 3853 | + this._toggle.apply( this, arguments ) : |
| 3854 | + fn == null || bool ? |
| 3855 | + this.each(function(){ |
| 3856 | + var state = bool ? fn : jQuery(this).is(":hidden"); |
| 3857 | + jQuery(this)[ state ? "show" : "hide" ](); |
| 3858 | + }) : |
| 3859 | + this.animate(genFx("toggle", 3), fn, fn2); |
| 3860 | + }, |
| 3861 | + |
| 3862 | + fadeTo: function(speed,to,callback){ |
| 3863 | + return this.animate({opacity: to}, speed, callback); |
| 3864 | + }, |
| 3865 | + |
| 3866 | + animate: function( prop, speed, easing, callback ) { |
| 3867 | + var optall = jQuery.speed(speed, easing, callback); |
| 3868 | + |
| 3869 | + return this[ optall.queue === false ? "each" : "queue" ](function(){ |
| 3870 | + |
| 3871 | + var opt = jQuery.extend({}, optall), p, |
| 3872 | + hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), |
| 3873 | + self = this; |
| 3874 | + |
| 3875 | + for ( p in prop ) { |
| 3876 | + if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) |
| 3877 | + return opt.complete.call(this); |
| 3878 | + |
| 3879 | + if ( ( p == "height" || p == "width" ) && this.style ) { |
| 3880 | + // Store display property |
| 3881 | + opt.display = jQuery.css(this, "display"); |
| 3882 | + |
| 3883 | + // Make sure that nothing sneaks out |
| 3884 | + opt.overflow = this.style.overflow; |
| 3885 | + } |
| 3886 | + } |
| 3887 | + |
| 3888 | + if ( opt.overflow != null ) |
| 3889 | + this.style.overflow = "hidden"; |
| 3890 | + |
| 3891 | + opt.curAnim = jQuery.extend({}, prop); |
| 3892 | + |
| 3893 | + jQuery.each( prop, function(name, val){ |
| 3894 | + var e = new jQuery.fx( self, opt, name ); |
| 3895 | + |
| 3896 | + if ( /toggle|show|hide/.test(val) ) |
| 3897 | + e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); |
| 3898 | + else { |
| 3899 | + var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), |
| 3900 | + start = e.cur(true) || 0; |
| 3901 | + |
| 3902 | + if ( parts ) { |
| 3903 | + var end = parseFloat(parts[2]), |
| 3904 | + unit = parts[3] || "px"; |
| 3905 | + |
| 3906 | + // We need to compute starting value |
| 3907 | + if ( unit != "px" ) { |
| 3908 | + self.style[ name ] = (end || 1) + unit; |
| 3909 | + start = ((end || 1) / e.cur(true)) * start; |
| 3910 | + self.style[ name ] = start + unit; |
| 3911 | + } |
| 3912 | + |
| 3913 | + // If a +=/-= token was provided, we're doing a relative animation |
| 3914 | + if ( parts[1] ) |
| 3915 | + end = ((parts[1] == "-=" ? -1 : 1) * end) + start; |
| 3916 | + |
| 3917 | + e.custom( start, end, unit ); |
| 3918 | + } else |
| 3919 | + e.custom( start, val, "" ); |
| 3920 | + } |
| 3921 | + }); |
| 3922 | + |
| 3923 | + // For JS strict compliance |
| 3924 | + return true; |
| 3925 | + }); |
| 3926 | + }, |
| 3927 | + |
| 3928 | + stop: function(clearQueue, gotoEnd){ |
| 3929 | + var timers = jQuery.timers; |
| 3930 | + |
| 3931 | + if (clearQueue) |
| 3932 | + this.queue([]); |
| 3933 | + |
| 3934 | + this.each(function(){ |
| 3935 | + // go in reverse order so anything added to the queue during the loop is ignored |
| 3936 | + for ( var i = timers.length - 1; i >= 0; i-- ) |
| 3937 | + if ( timers[i].elem == this ) { |
| 3938 | + if (gotoEnd) |
| 3939 | + // force the next step to be the last |
| 3940 | + timers[i](true); |
| 3941 | + timers.splice(i, 1); |
| 3942 | + } |
| 3943 | + }); |
| 3944 | + |
| 3945 | + // start the next in the queue if the last step wasn't forced |
| 3946 | + if (!gotoEnd) |
| 3947 | + this.dequeue(); |
| 3948 | + |
| 3949 | + return this; |
| 3950 | + } |
| 3951 | + |
| 3952 | +}); |
| 3953 | + |
| 3954 | +// Generate shortcuts for custom animations |
| 3955 | +jQuery.each({ |
| 3956 | + slideDown: genFx("show", 1), |
| 3957 | + slideUp: genFx("hide", 1), |
| 3958 | + slideToggle: genFx("toggle", 1), |
| 3959 | + fadeIn: { opacity: "show" }, |
| 3960 | + fadeOut: { opacity: "hide" } |
| 3961 | +}, function( name, props ){ |
| 3962 | + jQuery.fn[ name ] = function( speed, callback ){ |
| 3963 | + return this.animate( props, speed, callback ); |
| 3964 | + }; |
| 3965 | +}); |
| 3966 | + |
| 3967 | +jQuery.extend({ |
| 3968 | + |
| 3969 | + speed: function(speed, easing, fn) { |
| 3970 | + var opt = typeof speed === "object" ? speed : { |
| 3971 | + complete: fn || !fn && easing || |
| 3972 | + jQuery.isFunction( speed ) && speed, |
| 3973 | + duration: speed, |
| 3974 | + easing: fn && easing || easing && !jQuery.isFunction(easing) && easing |
| 3975 | + }; |
| 3976 | + |
| 3977 | + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
| 3978 | + jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; |
| 3979 | + |
| 3980 | + // Queueing |
| 3981 | + opt.old = opt.complete; |
| 3982 | + opt.complete = function(){ |
| 3983 | + if ( opt.queue !== false ) |
| 3984 | + jQuery(this).dequeue(); |
| 3985 | + if ( jQuery.isFunction( opt.old ) ) |
| 3986 | + opt.old.call( this ); |
| 3987 | + }; |
| 3988 | + |
| 3989 | + return opt; |
| 3990 | + }, |
| 3991 | + |
| 3992 | + easing: { |
| 3993 | + linear: function( p, n, firstNum, diff ) { |
| 3994 | + return firstNum + diff * p; |
| 3995 | + }, |
| 3996 | + swing: function( p, n, firstNum, diff ) { |
| 3997 | + return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
| 3998 | + } |
| 3999 | + }, |
| 4000 | + |
| 4001 | + timers: [], |
| 4002 | + |
| 4003 | + fx: function( elem, options, prop ){ |
| 4004 | + this.options = options; |
| 4005 | + this.elem = elem; |
| 4006 | + this.prop = prop; |
| 4007 | + |
| 4008 | + if ( !options.orig ) |
| 4009 | + options.orig = {}; |
| 4010 | + } |
| 4011 | + |
| 4012 | +}); |
| 4013 | + |
| 4014 | +jQuery.fx.prototype = { |
| 4015 | + |
| 4016 | + // Simple function for setting a style value |
| 4017 | + update: function(){ |
| 4018 | + if ( this.options.step ) |
| 4019 | + this.options.step.call( this.elem, this.now, this ); |
| 4020 | + |
| 4021 | + (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); |
| 4022 | + |
| 4023 | + // Set display property to block for height/width animations |
| 4024 | + if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) |
| 4025 | + this.elem.style.display = "block"; |
| 4026 | + }, |
| 4027 | + |
| 4028 | + // Get the current size |
| 4029 | + cur: function(force){ |
| 4030 | + if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) |
| 4031 | + return this.elem[ this.prop ]; |
| 4032 | + |
| 4033 | + var r = parseFloat(jQuery.css(this.elem, this.prop, force)); |
| 4034 | + return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; |
| 4035 | + }, |
| 4036 | + |
| 4037 | + // Start an animation from one number to another |
| 4038 | + custom: function(from, to, unit){ |
| 4039 | + this.startTime = now(); |
| 4040 | + this.start = from; |
| 4041 | + this.end = to; |
| 4042 | + this.unit = unit || this.unit || "px"; |
| 4043 | + this.now = this.start; |
| 4044 | + this.pos = this.state = 0; |
| 4045 | + |
| 4046 | + var self = this; |
| 4047 | + function t(gotoEnd){ |
| 4048 | + return self.step(gotoEnd); |
| 4049 | + } |
| 4050 | + |
| 4051 | + t.elem = this.elem; |
| 4052 | + |
| 4053 | + if ( t() && jQuery.timers.push(t) && !timerId ) { |
| 4054 | + timerId = setInterval(function(){ |
| 4055 | + var timers = jQuery.timers; |
| 4056 | + |
| 4057 | + for ( var i = 0; i < timers.length; i++ ) |
| 4058 | + if ( !timers[i]() ) |
| 4059 | + timers.splice(i--, 1); |
| 4060 | + |
| 4061 | + if ( !timers.length ) { |
| 4062 | + clearInterval( timerId ); |
| 4063 | + timerId = undefined; |
| 4064 | + } |
| 4065 | + }, 13); |
| 4066 | + } |
| 4067 | + }, |
| 4068 | + |
| 4069 | + // Simple 'show' function |
| 4070 | + show: function(){ |
| 4071 | + // Remember where we started, so that we can go back to it later |
| 4072 | + this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); |
| 4073 | + this.options.show = true; |
| 4074 | + |
| 4075 | + // Begin the animation |
| 4076 | + // Make sure that we start at a small width/height to avoid any |
| 4077 | + // flash of content |
| 4078 | + this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); |
| 4079 | + |
| 4080 | + // Start by showing the element |
| 4081 | + jQuery(this.elem).show(); |
| 4082 | + }, |
| 4083 | + |
| 4084 | + // Simple 'hide' function |
| 4085 | + hide: function(){ |
| 4086 | + // Remember where we started, so that we can go back to it later |
| 4087 | + this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); |
| 4088 | + this.options.hide = true; |
| 4089 | + |
| 4090 | + // Begin the animation |
| 4091 | + this.custom(this.cur(), 0); |
| 4092 | + }, |
| 4093 | + |
| 4094 | + // Each step of an animation |
| 4095 | + step: function(gotoEnd){ |
| 4096 | + var t = now(); |
| 4097 | + |
| 4098 | + if ( gotoEnd || t >= this.options.duration + this.startTime ) { |
| 4099 | + this.now = this.end; |
| 4100 | + this.pos = this.state = 1; |
| 4101 | + this.update(); |
| 4102 | + |
| 4103 | + this.options.curAnim[ this.prop ] = true; |
| 4104 | + |
| 4105 | + var done = true; |
| 4106 | + for ( var i in this.options.curAnim ) |
| 4107 | + if ( this.options.curAnim[i] !== true ) |
| 4108 | + done = false; |
| 4109 | + |
| 4110 | + if ( done ) { |
| 4111 | + if ( this.options.display != null ) { |
| 4112 | + // Reset the overflow |
| 4113 | + this.elem.style.overflow = this.options.overflow; |
| 4114 | + |
| 4115 | + // Reset the display |
| 4116 | + this.elem.style.display = this.options.display; |
| 4117 | + if ( jQuery.css(this.elem, "display") == "none" ) |
| 4118 | + this.elem.style.display = "block"; |
| 4119 | + } |
| 4120 | + |
| 4121 | + // Hide the element if the "hide" operation was done |
| 4122 | + if ( this.options.hide ) |
| 4123 | + jQuery(this.elem).hide(); |
| 4124 | + |
| 4125 | + // Reset the properties, if the item has been hidden or shown |
| 4126 | + if ( this.options.hide || this.options.show ) |
| 4127 | + for ( var p in this.options.curAnim ) |
| 4128 | + jQuery.attr(this.elem.style, p, this.options.orig[p]); |
| 4129 | + |
| 4130 | + // Execute the complete function |
| 4131 | + this.options.complete.call( this.elem ); |
| 4132 | + } |
| 4133 | + |
| 4134 | + return false; |
| 4135 | + } else { |
| 4136 | + var n = t - this.startTime; |
| 4137 | + this.state = n / this.options.duration; |
| 4138 | + |
| 4139 | + // Perform the easing function, defaults to swing |
| 4140 | + this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); |
| 4141 | + this.now = this.start + ((this.end - this.start) * this.pos); |
| 4142 | + |
| 4143 | + // Perform the next step of the animation |
| 4144 | + this.update(); |
| 4145 | + } |
| 4146 | + |
| 4147 | + return true; |
| 4148 | + } |
| 4149 | + |
| 4150 | +}; |
| 4151 | + |
| 4152 | +jQuery.extend( jQuery.fx, { |
| 4153 | + speeds:{ |
| 4154 | + slow: 600, |
| 4155 | + fast: 200, |
| 4156 | + // Default speed |
| 4157 | + _default: 400 |
| 4158 | + }, |
| 4159 | + step: { |
| 4160 | + |
| 4161 | + opacity: function(fx){ |
| 4162 | + jQuery.attr(fx.elem.style, "opacity", fx.now); |
| 4163 | + }, |
| 4164 | + |
| 4165 | + _default: function(fx){ |
| 4166 | + if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) |
| 4167 | + fx.elem.style[ fx.prop ] = fx.now + fx.unit; |
| 4168 | + else |
| 4169 | + fx.elem[ fx.prop ] = fx.now; |
| 4170 | + } |
| 4171 | + } |
| 4172 | +}); |
| 4173 | +if ( document.documentElement["getBoundingClientRect"] ) |
| 4174 | + jQuery.fn.offset = function() { |
| 4175 | + if ( !this[0] ) return { top: 0, left: 0 }; |
| 4176 | + if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); |
| 4177 | + var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, |
| 4178 | + clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, |
| 4179 | + top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, |
| 4180 | + left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; |
| 4181 | + return { top: top, left: left }; |
| 4182 | + }; |
| 4183 | +else |
| 4184 | + jQuery.fn.offset = function() { |
| 4185 | + if ( !this[0] ) return { top: 0, left: 0 }; |
| 4186 | + if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); |
| 4187 | + jQuery.offset.initialized || jQuery.offset.initialize(); |
| 4188 | + |
| 4189 | + var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, |
| 4190 | + doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, |
| 4191 | + body = doc.body, defaultView = doc.defaultView, |
| 4192 | + prevComputedStyle = defaultView.getComputedStyle(elem, null), |
| 4193 | + top = elem.offsetTop, left = elem.offsetLeft; |
| 4194 | + |
| 4195 | + while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { |
| 4196 | + computedStyle = defaultView.getComputedStyle(elem, null); |
| 4197 | + top -= elem.scrollTop, left -= elem.scrollLeft; |
| 4198 | + if ( elem === offsetParent ) { |
| 4199 | + top += elem.offsetTop, left += elem.offsetLeft; |
| 4200 | + if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) |
| 4201 | + top += parseInt( computedStyle.borderTopWidth, 10) || 0, |
| 4202 | + left += parseInt( computedStyle.borderLeftWidth, 10) || 0; |
| 4203 | + prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; |
| 4204 | + } |
| 4205 | + if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) |
| 4206 | + top += parseInt( computedStyle.borderTopWidth, 10) || 0, |
| 4207 | + left += parseInt( computedStyle.borderLeftWidth, 10) || 0; |
| 4208 | + prevComputedStyle = computedStyle; |
| 4209 | + } |
| 4210 | + |
| 4211 | + if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) |
| 4212 | + top += body.offsetTop, |
| 4213 | + left += body.offsetLeft; |
| 4214 | + |
| 4215 | + if ( prevComputedStyle.position === "fixed" ) |
| 4216 | + top += Math.max(docElem.scrollTop, body.scrollTop), |
| 4217 | + left += Math.max(docElem.scrollLeft, body.scrollLeft); |
| 4218 | + |
| 4219 | + return { top: top, left: left }; |
| 4220 | + }; |
| 4221 | + |
| 4222 | +jQuery.offset = { |
| 4223 | + initialize: function() { |
| 4224 | + if ( this.initialized ) return; |
| 4225 | + var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, |
| 4226 | + html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>'; |
| 4227 | + |
| 4228 | + rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; |
| 4229 | + for ( prop in rules ) container.style[prop] = rules[prop]; |
| 4230 | + |
| 4231 | + container.innerHTML = html; |
| 4232 | + body.insertBefore(container, body.firstChild); |
| 4233 | + innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; |
| 4234 | + |
| 4235 | + this.doesNotAddBorder = (checkDiv.offsetTop !== 5); |
| 4236 | + this.doesAddBorderForTableAndCells = (td.offsetTop === 5); |
| 4237 | + |
| 4238 | + innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; |
| 4239 | + this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); |
| 4240 | + |
| 4241 | + body.style.marginTop = '1px'; |
| 4242 | + this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); |
| 4243 | + body.style.marginTop = bodyMarginTop; |
| 4244 | + |
| 4245 | + body.removeChild(container); |
| 4246 | + this.initialized = true; |
| 4247 | + }, |
| 4248 | + |
| 4249 | + bodyOffset: function(body) { |
| 4250 | + jQuery.offset.initialized || jQuery.offset.initialize(); |
| 4251 | + var top = body.offsetTop, left = body.offsetLeft; |
| 4252 | + if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) |
| 4253 | + top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, |
| 4254 | + left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; |
| 4255 | + return { top: top, left: left }; |
| 4256 | + } |
| 4257 | +}; |
| 4258 | + |
| 4259 | + |
| 4260 | +jQuery.fn.extend({ |
| 4261 | + position: function() { |
| 4262 | + var left = 0, top = 0, results; |
| 4263 | + |
| 4264 | + if ( this[0] ) { |
| 4265 | + // Get *real* offsetParent |
| 4266 | + var offsetParent = this.offsetParent(), |
| 4267 | + |
| 4268 | + // Get correct offsets |
| 4269 | + offset = this.offset(), |
| 4270 | + parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); |
| 4271 | + |
| 4272 | + // Subtract element margins |
| 4273 | + // note: when an element has margin: auto the offsetLeft and marginLeft |
| 4274 | + // are the same in Safari causing offset.left to incorrectly be 0 |
| 4275 | + offset.top -= num( this, 'marginTop' ); |
| 4276 | + offset.left -= num( this, 'marginLeft' ); |
| 4277 | + |
| 4278 | + // Add offsetParent borders |
| 4279 | + parentOffset.top += num( offsetParent, 'borderTopWidth' ); |
| 4280 | + parentOffset.left += num( offsetParent, 'borderLeftWidth' ); |
| 4281 | + |
| 4282 | + // Subtract the two offsets |
| 4283 | + results = { |
| 4284 | + top: offset.top - parentOffset.top, |
| 4285 | + left: offset.left - parentOffset.left |
| 4286 | + }; |
| 4287 | + } |
| 4288 | + |
| 4289 | + return results; |
| 4290 | + }, |
| 4291 | + |
| 4292 | + offsetParent: function() { |
| 4293 | + var offsetParent = this[0].offsetParent || document.body; |
| 4294 | + while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) |
| 4295 | + offsetParent = offsetParent.offsetParent; |
| 4296 | + return jQuery(offsetParent); |
| 4297 | + } |
| 4298 | +}); |
| 4299 | + |
| 4300 | + |
| 4301 | +// Create scrollLeft and scrollTop methods |
| 4302 | +jQuery.each( ['Left', 'Top'], function(i, name) { |
| 4303 | + var method = 'scroll' + name; |
| 4304 | + |
| 4305 | + jQuery.fn[ method ] = function(val) { |
| 4306 | + if (!this[0]) return null; |
| 4307 | + |
| 4308 | + return val !== undefined ? |
| 4309 | + |
| 4310 | + // Set the scroll offset |
| 4311 | + this.each(function() { |
| 4312 | + this == window || this == document ? |
| 4313 | + window.scrollTo( |
| 4314 | + !i ? val : jQuery(window).scrollLeft(), |
| 4315 | + i ? val : jQuery(window).scrollTop() |
| 4316 | + ) : |
| 4317 | + this[ method ] = val; |
| 4318 | + }) : |
| 4319 | + |
| 4320 | + // Return the scroll offset |
| 4321 | + this[0] == window || this[0] == document ? |
| 4322 | + self[ i ? 'pageYOffset' : 'pageXOffset' ] || |
| 4323 | + jQuery.boxModel && document.documentElement[ method ] || |
| 4324 | + document.body[ method ] : |
| 4325 | + this[0][ method ]; |
| 4326 | + }; |
| 4327 | +}); |
| 4328 | +// Create innerHeight, innerWidth, outerHeight and outerWidth methods |
| 4329 | +jQuery.each([ "Height", "Width" ], function(i, name){ |
| 4330 | + |
| 4331 | + var tl = i ? "Left" : "Top", // top or left |
| 4332 | + br = i ? "Right" : "Bottom", // bottom or right |
| 4333 | + lower = name.toLowerCase(); |
| 4334 | + |
| 4335 | + // innerHeight and innerWidth |
| 4336 | + jQuery.fn["inner" + name] = function(){ |
| 4337 | + return this[0] ? |
| 4338 | + jQuery.css( this[0], lower, false, "padding" ) : |
| 4339 | + null; |
| 4340 | + }; |
| 4341 | + |
| 4342 | + // outerHeight and outerWidth |
| 4343 | + jQuery.fn["outer" + name] = function(margin) { |
| 4344 | + return this[0] ? |
| 4345 | + jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : |
| 4346 | + null; |
| 4347 | + }; |
| 4348 | + |
| 4349 | + var type = name.toLowerCase(); |
| 4350 | + |
| 4351 | + jQuery.fn[ type ] = function( size ) { |
| 4352 | + // Get window width or height |
| 4353 | + return this[0] == window ? |
| 4354 | + // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode |
| 4355 | + document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || |
| 4356 | + document.body[ "client" + name ] : |
| 4357 | + |
| 4358 | + // Get document width or height |
| 4359 | + this[0] == document ? |
| 4360 | + // Either scroll[Width/Height] or offset[Width/Height], whichever is greater |
| 4361 | + Math.max( |
| 4362 | + document.documentElement["client" + name], |
| 4363 | + document.body["scroll" + name], document.documentElement["scroll" + name], |
| 4364 | + document.body["offset" + name], document.documentElement["offset" + name] |
| 4365 | + ) : |
| 4366 | + |
| 4367 | + // Get or set width or height on the element |
| 4368 | + size === undefined ? |
| 4369 | + // Get width or height on the element |
| 4370 | + (this.length ? jQuery.css( this[0], type ) : null) : |
| 4371 | + |
| 4372 | + // Set the width or height on the element (default to pixels if value is unitless) |
| 4373 | + this.css( type, typeof size === "string" ? size : size + "px" ); |
| 4374 | + }; |
| 4375 | + |
| 4376 | +}); |
| 4377 | +})(); |
| 4378 | +/* |
| 4379 | + * jQuery UI 1.7.2 |
| 4380 | + * |
| 4381 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 4382 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 4383 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 4384 | + * |
| 4385 | + * http://docs.jquery.com/UI |
| 4386 | + */ |
| 4387 | +;jQuery.ui || (function($) { |
| 4388 | + |
| 4389 | +var _remove = $.fn.remove, |
| 4390 | + isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); |
| 4391 | + |
| 4392 | +//Helper functions and ui object |
| 4393 | +$.ui = { |
| 4394 | + version: "1.7.2", |
| 4395 | + |
| 4396 | + // $.ui.plugin is deprecated. Use the proxy pattern instead. |
| 4397 | + plugin: { |
| 4398 | + add: function(module, option, set) { |
| 4399 | + var proto = $.ui[module].prototype; |
| 4400 | + for(var i in set) { |
| 4401 | + proto.plugins[i] = proto.plugins[i] || []; |
| 4402 | + proto.plugins[i].push([option, set[i]]); |
| 4403 | + } |
| 4404 | + }, |
| 4405 | + call: function(instance, name, args) { |
| 4406 | + var set = instance.plugins[name]; |
| 4407 | + if(!set || !instance.element[0].parentNode) { return; } |
| 4408 | + |
| 4409 | + for (var i = 0; i < set.length; i++) { |
| 4410 | + if (instance.options[set[i][0]]) { |
| 4411 | + set[i][1].apply(instance.element, args); |
| 4412 | + } |
| 4413 | + } |
| 4414 | + } |
| 4415 | + }, |
| 4416 | + |
| 4417 | + contains: function(a, b) { |
| 4418 | + return document.compareDocumentPosition |
| 4419 | + ? a.compareDocumentPosition(b) & 16 |
| 4420 | + : a !== b && a.contains(b); |
| 4421 | + }, |
| 4422 | + |
| 4423 | + hasScroll: function(el, a) { |
| 4424 | + |
| 4425 | + //If overflow is hidden, the element might have extra content, but the user wants to hide it |
| 4426 | + if ($(el).css('overflow') == 'hidden') { return false; } |
| 4427 | + |
| 4428 | + var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', |
| 4429 | + has = false; |
| 4430 | + |
| 4431 | + if (el[scroll] > 0) { return true; } |
| 4432 | + |
| 4433 | + // TODO: determine which cases actually cause this to happen |
| 4434 | + // if the element doesn't have the scroll set, see if it's possible to |
| 4435 | + // set the scroll |
| 4436 | + el[scroll] = 1; |
| 4437 | + has = (el[scroll] > 0); |
| 4438 | + el[scroll] = 0; |
| 4439 | + return has; |
| 4440 | + }, |
| 4441 | + |
| 4442 | + isOverAxis: function(x, reference, size) { |
| 4443 | + //Determines when x coordinate is over "b" element axis |
| 4444 | + return (x > reference) && (x < (reference + size)); |
| 4445 | + }, |
| 4446 | + |
| 4447 | + isOver: function(y, x, top, left, height, width) { |
| 4448 | + //Determines when x, y coordinates is over "b" element |
| 4449 | + return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); |
| 4450 | + }, |
| 4451 | + |
| 4452 | + keyCode: { |
| 4453 | + BACKSPACE: 8, |
| 4454 | + CAPS_LOCK: 20, |
| 4455 | + COMMA: 188, |
| 4456 | + CONTROL: 17, |
| 4457 | + DELETE: 46, |
| 4458 | + DOWN: 40, |
| 4459 | + END: 35, |
| 4460 | + ENTER: 13, |
| 4461 | + ESCAPE: 27, |
| 4462 | + HOME: 36, |
| 4463 | + INSERT: 45, |
| 4464 | + LEFT: 37, |
| 4465 | + NUMPAD_ADD: 107, |
| 4466 | + NUMPAD_DECIMAL: 110, |
| 4467 | + NUMPAD_DIVIDE: 111, |
| 4468 | + NUMPAD_ENTER: 108, |
| 4469 | + NUMPAD_MULTIPLY: 106, |
| 4470 | + NUMPAD_SUBTRACT: 109, |
| 4471 | + PAGE_DOWN: 34, |
| 4472 | + PAGE_UP: 33, |
| 4473 | + PERIOD: 190, |
| 4474 | + RIGHT: 39, |
| 4475 | + SHIFT: 16, |
| 4476 | + SPACE: 32, |
| 4477 | + TAB: 9, |
| 4478 | + UP: 38 |
| 4479 | + } |
| 4480 | +}; |
| 4481 | + |
| 4482 | +// WAI-ARIA normalization |
| 4483 | +if (isFF2) { |
| 4484 | + var attr = $.attr, |
| 4485 | + removeAttr = $.fn.removeAttr, |
| 4486 | + ariaNS = "http://www.w3.org/2005/07/aaa", |
| 4487 | + ariaState = /^aria-/, |
| 4488 | + ariaRole = /^wairole:/; |
| 4489 | + |
| 4490 | + $.attr = function(elem, name, value) { |
| 4491 | + var set = value !== undefined; |
| 4492 | + |
| 4493 | + return (name == 'role' |
| 4494 | + ? (set |
| 4495 | + ? attr.call(this, elem, name, "wairole:" + value) |
| 4496 | + : (attr.apply(this, arguments) || "").replace(ariaRole, "")) |
| 4497 | + : (ariaState.test(name) |
| 4498 | + ? (set |
| 4499 | + ? elem.setAttributeNS(ariaNS, |
| 4500 | + name.replace(ariaState, "aaa:"), value) |
| 4501 | + : attr.call(this, elem, name.replace(ariaState, "aaa:"))) |
| 4502 | + : attr.apply(this, arguments))); |
| 4503 | + }; |
| 4504 | + |
| 4505 | + $.fn.removeAttr = function(name) { |
| 4506 | + return (ariaState.test(name) |
| 4507 | + ? this.each(function() { |
| 4508 | + this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); |
| 4509 | + }) : removeAttr.call(this, name)); |
| 4510 | + }; |
| 4511 | +} |
| 4512 | + |
| 4513 | +//jQuery plugins |
| 4514 | +$.fn.extend({ |
| 4515 | + remove: function() { |
| 4516 | + // Safari has a native remove event which actually removes DOM elements, |
| 4517 | + // so we have to use triggerHandler instead of trigger (#3037). |
| 4518 | + $("*", this).add(this).each(function() { |
| 4519 | + $(this).triggerHandler("remove"); |
| 4520 | + }); |
| 4521 | + return _remove.apply(this, arguments ); |
| 4522 | + }, |
| 4523 | + |
| 4524 | + enableSelection: function() { |
| 4525 | + return this |
| 4526 | + .attr('unselectable', 'off') |
| 4527 | + .css('MozUserSelect', '') |
| 4528 | + .unbind('selectstart.ui'); |
| 4529 | + }, |
| 4530 | + |
| 4531 | + disableSelection: function() { |
| 4532 | + return this |
| 4533 | + .attr('unselectable', 'on') |
| 4534 | + .css('MozUserSelect', 'none') |
| 4535 | + .bind('selectstart.ui', function() { return false; }); |
| 4536 | + }, |
| 4537 | + |
| 4538 | + scrollParent: function() { |
| 4539 | + var scrollParent; |
| 4540 | + if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { |
| 4541 | + scrollParent = this.parents().filter(function() { |
| 4542 | + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); |
| 4543 | + }).eq(0); |
| 4544 | + } else { |
| 4545 | + scrollParent = this.parents().filter(function() { |
| 4546 | + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); |
| 4547 | + }).eq(0); |
| 4548 | + } |
| 4549 | + |
| 4550 | + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; |
| 4551 | + } |
| 4552 | +}); |
| 4553 | + |
| 4554 | + |
| 4555 | +//Additional selectors |
| 4556 | +$.extend($.expr[':'], { |
| 4557 | + data: function(elem, i, match) { |
| 4558 | + return !!$.data(elem, match[3]); |
| 4559 | + }, |
| 4560 | + |
| 4561 | + focusable: function(element) { |
| 4562 | + var nodeName = element.nodeName.toLowerCase(), |
| 4563 | + tabIndex = $.attr(element, 'tabindex'); |
| 4564 | + return (/input|select|textarea|button|object/.test(nodeName) |
| 4565 | + ? !element.disabled |
| 4566 | + : 'a' == nodeName || 'area' == nodeName |
| 4567 | + ? element.href || !isNaN(tabIndex) |
| 4568 | + : !isNaN(tabIndex)) |
| 4569 | + // the element and all of its ancestors must be visible |
| 4570 | + // the browser may report that the area is hidden |
| 4571 | + && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; |
| 4572 | + }, |
| 4573 | + |
| 4574 | + tabbable: function(element) { |
| 4575 | + var tabIndex = $.attr(element, 'tabindex'); |
| 4576 | + return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); |
| 4577 | + } |
| 4578 | +}); |
| 4579 | + |
| 4580 | + |
| 4581 | +// $.widget is a factory to create jQuery plugins |
| 4582 | +// taking some boilerplate code out of the plugin code |
| 4583 | +function getter(namespace, plugin, method, args) { |
| 4584 | + function getMethods(type) { |
| 4585 | + var methods = $[namespace][plugin][type] || []; |
| 4586 | + return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); |
| 4587 | + } |
| 4588 | + |
| 4589 | + var methods = getMethods('getter'); |
| 4590 | + if (args.length == 1 && typeof args[0] == 'string') { |
| 4591 | + methods = methods.concat(getMethods('getterSetter')); |
| 4592 | + } |
| 4593 | + return ($.inArray(method, methods) != -1); |
| 4594 | +} |
| 4595 | + |
| 4596 | +$.widget = function(name, prototype) { |
| 4597 | + var namespace = name.split(".")[0]; |
| 4598 | + name = name.split(".")[1]; |
| 4599 | + |
| 4600 | + // create plugin method |
| 4601 | + $.fn[name] = function(options) { |
| 4602 | + var isMethodCall = (typeof options == 'string'), |
| 4603 | + args = Array.prototype.slice.call(arguments, 1); |
| 4604 | + |
| 4605 | + // prevent calls to internal methods |
| 4606 | + if (isMethodCall && options.substring(0, 1) == '_') { |
| 4607 | + return this; |
| 4608 | + } |
| 4609 | + |
| 4610 | + // handle getter methods |
| 4611 | + if (isMethodCall && getter(namespace, name, options, args)) { |
| 4612 | + var instance = $.data(this[0], name); |
| 4613 | + return (instance ? instance[options].apply(instance, args) |
| 4614 | + : undefined); |
| 4615 | + } |
| 4616 | + |
| 4617 | + // handle initialization and non-getter methods |
| 4618 | + return this.each(function() { |
| 4619 | + var instance = $.data(this, name); |
| 4620 | + |
| 4621 | + // constructor |
| 4622 | + (!instance && !isMethodCall && |
| 4623 | + $.data(this, name, new $[namespace][name](this, options))._init()); |
| 4624 | + |
| 4625 | + // method call |
| 4626 | + (instance && isMethodCall && $.isFunction(instance[options]) && |
| 4627 | + instance[options].apply(instance, args)); |
| 4628 | + }); |
| 4629 | + }; |
| 4630 | + |
| 4631 | + // create widget constructor |
| 4632 | + $[namespace] = $[namespace] || {}; |
| 4633 | + $[namespace][name] = function(element, options) { |
| 4634 | + var self = this; |
| 4635 | + |
| 4636 | + this.namespace = namespace; |
| 4637 | + this.widgetName = name; |
| 4638 | + this.widgetEventPrefix = $[namespace][name].eventPrefix || name; |
| 4639 | + this.widgetBaseClass = namespace + '-' + name; |
| 4640 | + |
| 4641 | + this.options = $.extend({}, |
| 4642 | + $.widget.defaults, |
| 4643 | + $[namespace][name].defaults, |
| 4644 | + $.metadata && $.metadata.get(element)[name], |
| 4645 | + options); |
| 4646 | + |
| 4647 | + this.element = $(element) |
| 4648 | + .bind('setData.' + name, function(event, key, value) { |
| 4649 | + if (event.target == element) { |
| 4650 | + return self._setData(key, value); |
| 4651 | + } |
| 4652 | + }) |
| 4653 | + .bind('getData.' + name, function(event, key) { |
| 4654 | + if (event.target == element) { |
| 4655 | + return self._getData(key); |
| 4656 | + } |
| 4657 | + }) |
| 4658 | + .bind('remove', function() { |
| 4659 | + return self.destroy(); |
| 4660 | + }); |
| 4661 | + }; |
| 4662 | + |
| 4663 | + // add widget prototype |
| 4664 | + $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); |
| 4665 | + |
| 4666 | + // TODO: merge getter and getterSetter properties from widget prototype |
| 4667 | + // and plugin prototype |
| 4668 | + $[namespace][name].getterSetter = 'option'; |
| 4669 | +}; |
| 4670 | + |
| 4671 | +$.widget.prototype = { |
| 4672 | + _init: function() {}, |
| 4673 | + destroy: function() { |
| 4674 | + this.element.removeData(this.widgetName) |
| 4675 | + .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') |
| 4676 | + .removeAttr('aria-disabled'); |
| 4677 | + }, |
| 4678 | + |
| 4679 | + option: function(key, value) { |
| 4680 | + var options = key, |
| 4681 | + self = this; |
| 4682 | + |
| 4683 | + if (typeof key == "string") { |
| 4684 | + if (value === undefined) { |
| 4685 | + return this._getData(key); |
| 4686 | + } |
| 4687 | + options = {}; |
| 4688 | + options[key] = value; |
| 4689 | + } |
| 4690 | + |
| 4691 | + $.each(options, function(key, value) { |
| 4692 | + self._setData(key, value); |
| 4693 | + }); |
| 4694 | + }, |
| 4695 | + _getData: function(key) { |
| 4696 | + return this.options[key]; |
| 4697 | + }, |
| 4698 | + _setData: function(key, value) { |
| 4699 | + this.options[key] = value; |
| 4700 | + |
| 4701 | + if (key == 'disabled') { |
| 4702 | + this.element |
| 4703 | + [value ? 'addClass' : 'removeClass']( |
| 4704 | + this.widgetBaseClass + '-disabled' + ' ' + |
| 4705 | + this.namespace + '-state-disabled') |
| 4706 | + .attr("aria-disabled", value); |
| 4707 | + } |
| 4708 | + }, |
| 4709 | + |
| 4710 | + enable: function() { |
| 4711 | + this._setData('disabled', false); |
| 4712 | + }, |
| 4713 | + disable: function() { |
| 4714 | + this._setData('disabled', true); |
| 4715 | + }, |
| 4716 | + |
| 4717 | + _trigger: function(type, event, data) { |
| 4718 | + var callback = this.options[type], |
| 4719 | + eventName = (type == this.widgetEventPrefix |
| 4720 | + ? type : this.widgetEventPrefix + type); |
| 4721 | + |
| 4722 | + event = $.Event(event); |
| 4723 | + event.type = eventName; |
| 4724 | + |
| 4725 | + // copy original event properties over to the new event |
| 4726 | + // this would happen if we could call $.event.fix instead of $.Event |
| 4727 | + // but we don't have a way to force an event to be fixed multiple times |
| 4728 | + if (event.originalEvent) { |
| 4729 | + for (var i = $.event.props.length, prop; i;) { |
| 4730 | + prop = $.event.props[--i]; |
| 4731 | + event[prop] = event.originalEvent[prop]; |
| 4732 | + } |
| 4733 | + } |
| 4734 | + |
| 4735 | + this.element.trigger(event, data); |
| 4736 | + |
| 4737 | + return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false |
| 4738 | + || event.isDefaultPrevented()); |
| 4739 | + } |
| 4740 | +}; |
| 4741 | + |
| 4742 | +$.widget.defaults = { |
| 4743 | + disabled: false |
| 4744 | +}; |
| 4745 | + |
| 4746 | + |
| 4747 | +/** Mouse Interaction Plugin **/ |
| 4748 | + |
| 4749 | +$.ui.mouse = { |
| 4750 | + _mouseInit: function() { |
| 4751 | + var self = this; |
| 4752 | + |
| 4753 | + this.element |
| 4754 | + .bind('mousedown.'+this.widgetName, function(event) { |
| 4755 | + return self._mouseDown(event); |
| 4756 | + }) |
| 4757 | + .bind('click.'+this.widgetName, function(event) { |
| 4758 | + if(self._preventClickEvent) { |
| 4759 | + self._preventClickEvent = false; |
| 4760 | + event.stopImmediatePropagation(); |
| 4761 | + return false; |
| 4762 | + } |
| 4763 | + }); |
| 4764 | + |
| 4765 | + // Prevent text selection in IE |
| 4766 | + if ($.browser.msie) { |
| 4767 | + this._mouseUnselectable = this.element.attr('unselectable'); |
| 4768 | + this.element.attr('unselectable', 'on'); |
| 4769 | + } |
| 4770 | + |
| 4771 | + this.started = false; |
| 4772 | + }, |
| 4773 | + |
| 4774 | + // TODO: make sure destroying one instance of mouse doesn't mess with |
| 4775 | + // other instances of mouse |
| 4776 | + _mouseDestroy: function() { |
| 4777 | + this.element.unbind('.'+this.widgetName); |
| 4778 | + |
| 4779 | + // Restore text selection in IE |
| 4780 | + ($.browser.msie |
| 4781 | + && this.element.attr('unselectable', this._mouseUnselectable)); |
| 4782 | + }, |
| 4783 | + |
| 4784 | + _mouseDown: function(event) { |
| 4785 | + // don't let more than one widget handle mouseStart |
| 4786 | + // TODO: figure out why we have to use originalEvent |
| 4787 | + event.originalEvent = event.originalEvent || {}; |
| 4788 | + if (event.originalEvent.mouseHandled) { return; } |
| 4789 | + |
| 4790 | + // we may have missed mouseup (out of window) |
| 4791 | + (this._mouseStarted && this._mouseUp(event)); |
| 4792 | + |
| 4793 | + this._mouseDownEvent = event; |
| 4794 | + |
| 4795 | + var self = this, |
| 4796 | + btnIsLeft = (event.which == 1), |
| 4797 | + elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); |
| 4798 | + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { |
| 4799 | + return true; |
| 4800 | + } |
| 4801 | + |
| 4802 | + this.mouseDelayMet = !this.options.delay; |
| 4803 | + if (!this.mouseDelayMet) { |
| 4804 | + this._mouseDelayTimer = setTimeout(function() { |
| 4805 | + self.mouseDelayMet = true; |
| 4806 | + }, this.options.delay); |
| 4807 | + } |
| 4808 | + |
| 4809 | + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { |
| 4810 | + this._mouseStarted = (this._mouseStart(event) !== false); |
| 4811 | + if (!this._mouseStarted) { |
| 4812 | + event.preventDefault(); |
| 4813 | + return true; |
| 4814 | + } |
| 4815 | + } |
| 4816 | + |
| 4817 | + // these delegates are required to keep context |
| 4818 | + this._mouseMoveDelegate = function(event) { |
| 4819 | + return self._mouseMove(event); |
| 4820 | + }; |
| 4821 | + this._mouseUpDelegate = function(event) { |
| 4822 | + return self._mouseUp(event); |
| 4823 | + }; |
| 4824 | + $(document) |
| 4825 | + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) |
| 4826 | + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); |
| 4827 | + |
| 4828 | + // preventDefault() is used to prevent the selection of text here - |
| 4829 | + // however, in Safari, this causes select boxes not to be selectable |
| 4830 | + // anymore, so this fix is needed |
| 4831 | + ($.browser.safari || event.preventDefault()); |
| 4832 | + |
| 4833 | + event.originalEvent.mouseHandled = true; |
| 4834 | + return true; |
| 4835 | + }, |
| 4836 | + |
| 4837 | + _mouseMove: function(event) { |
| 4838 | + // IE mouseup check - mouseup happened when mouse was out of window |
| 4839 | + if ($.browser.msie && !event.button) { |
| 4840 | + return this._mouseUp(event); |
| 4841 | + } |
| 4842 | + |
| 4843 | + if (this._mouseStarted) { |
| 4844 | + this._mouseDrag(event); |
| 4845 | + return event.preventDefault(); |
| 4846 | + } |
| 4847 | + |
| 4848 | + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { |
| 4849 | + this._mouseStarted = |
| 4850 | + (this._mouseStart(this._mouseDownEvent, event) !== false); |
| 4851 | + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); |
| 4852 | + } |
| 4853 | + |
| 4854 | + return !this._mouseStarted; |
| 4855 | + }, |
| 4856 | + |
| 4857 | + _mouseUp: function(event) { |
| 4858 | + $(document) |
| 4859 | + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) |
| 4860 | + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); |
| 4861 | + |
| 4862 | + if (this._mouseStarted) { |
| 4863 | + this._mouseStarted = false; |
| 4864 | + this._preventClickEvent = (event.target == this._mouseDownEvent.target); |
| 4865 | + this._mouseStop(event); |
| 4866 | + } |
| 4867 | + |
| 4868 | + return false; |
| 4869 | + }, |
| 4870 | + |
| 4871 | + _mouseDistanceMet: function(event) { |
| 4872 | + return (Math.max( |
| 4873 | + Math.abs(this._mouseDownEvent.pageX - event.pageX), |
| 4874 | + Math.abs(this._mouseDownEvent.pageY - event.pageY) |
| 4875 | + ) >= this.options.distance |
| 4876 | + ); |
| 4877 | + }, |
| 4878 | + |
| 4879 | + _mouseDelayMet: function(event) { |
| 4880 | + return this.mouseDelayMet; |
| 4881 | + }, |
| 4882 | + |
| 4883 | + // These are placeholder methods, to be overriden by extending plugin |
| 4884 | + _mouseStart: function(event) {}, |
| 4885 | + _mouseDrag: function(event) {}, |
| 4886 | + _mouseStop: function(event) {}, |
| 4887 | + _mouseCapture: function(event) { return true; } |
| 4888 | +}; |
| 4889 | + |
| 4890 | +$.ui.mouse.defaults = { |
| 4891 | + cancel: null, |
| 4892 | + distance: 1, |
| 4893 | + delay: 0 |
| 4894 | +}; |
| 4895 | + |
| 4896 | +})(jQuery); |
| 4897 | +/* |
| 4898 | + * jQuery UI Draggable 1.7.2 |
| 4899 | + * |
| 4900 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 4901 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 4902 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 4903 | + * |
| 4904 | + * http://docs.jquery.com/UI/Draggables |
| 4905 | + * |
| 4906 | + * Depends: |
| 4907 | + * ui.core.js |
| 4908 | + */ |
| 4909 | +(function($) { |
| 4910 | + |
| 4911 | +$.widget("ui.draggable", $.extend({}, $.ui.mouse, { |
| 4912 | + |
| 4913 | + _init: function() { |
| 4914 | + |
| 4915 | + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) |
| 4916 | + this.element[0].style.position = 'relative'; |
| 4917 | + |
| 4918 | + (this.options.addClasses && this.element.addClass("ui-draggable")); |
| 4919 | + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); |
| 4920 | + |
| 4921 | + this._mouseInit(); |
| 4922 | + |
| 4923 | + }, |
| 4924 | + |
| 4925 | + destroy: function() { |
| 4926 | + if(!this.element.data('draggable')) return; |
| 4927 | + this.element |
| 4928 | + .removeData("draggable") |
| 4929 | + .unbind(".draggable") |
| 4930 | + .removeClass("ui-draggable" |
| 4931 | + + " ui-draggable-dragging" |
| 4932 | + + " ui-draggable-disabled"); |
| 4933 | + this._mouseDestroy(); |
| 4934 | + }, |
| 4935 | + |
| 4936 | + _mouseCapture: function(event) { |
| 4937 | + |
| 4938 | + var o = this.options; |
| 4939 | + |
| 4940 | + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) |
| 4941 | + return false; |
| 4942 | + |
| 4943 | + //Quit if we're not on a valid handle |
| 4944 | + this.handle = this._getHandle(event); |
| 4945 | + if (!this.handle) |
| 4946 | + return false; |
| 4947 | + |
| 4948 | + return true; |
| 4949 | + |
| 4950 | + }, |
| 4951 | + |
| 4952 | + _mouseStart: function(event) { |
| 4953 | + |
| 4954 | + var o = this.options; |
| 4955 | + |
| 4956 | + //Create and append the visible helper |
| 4957 | + this.helper = this._createHelper(event); |
| 4958 | + |
| 4959 | + //Cache the helper size |
| 4960 | + this._cacheHelperProportions(); |
| 4961 | + |
| 4962 | + //If ddmanager is used for droppables, set the global draggable |
| 4963 | + if($.ui.ddmanager) |
| 4964 | + $.ui.ddmanager.current = this; |
| 4965 | + |
| 4966 | + /* |
| 4967 | + * - Position generation - |
| 4968 | + * This block generates everything position related - it's the core of draggables. |
| 4969 | + */ |
| 4970 | + |
| 4971 | + //Cache the margins of the original element |
| 4972 | + this._cacheMargins(); |
| 4973 | + |
| 4974 | + //Store the helper's css position |
| 4975 | + this.cssPosition = this.helper.css("position"); |
| 4976 | + this.scrollParent = this.helper.scrollParent(); |
| 4977 | + |
| 4978 | + //The element's absolute position on the page minus margins |
| 4979 | + this.offset = this.element.offset(); |
| 4980 | + this.offset = { |
| 4981 | + top: this.offset.top - this.margins.top, |
| 4982 | + left: this.offset.left - this.margins.left |
| 4983 | + }; |
| 4984 | + |
| 4985 | + $.extend(this.offset, { |
| 4986 | + click: { //Where the click happened, relative to the element |
| 4987 | + left: event.pageX - this.offset.left, |
| 4988 | + top: event.pageY - this.offset.top |
| 4989 | + }, |
| 4990 | + parent: this._getParentOffset(), |
| 4991 | + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper |
| 4992 | + }); |
| 4993 | + |
| 4994 | + //Generate the original position |
| 4995 | + this.originalPosition = this._generatePosition(event); |
| 4996 | + this.originalPageX = event.pageX; |
| 4997 | + this.originalPageY = event.pageY; |
| 4998 | + |
| 4999 | + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied |
| 5000 | + if(o.cursorAt) |
| 5001 | + this._adjustOffsetFromHelper(o.cursorAt); |
| 5002 | + |
| 5003 | + //Set a containment if given in the options |
| 5004 | + if(o.containment) |
| 5005 | + this._setContainment(); |
| 5006 | + |
| 5007 | + //Call plugins and callbacks |
| 5008 | + this._trigger("start", event); |
| 5009 | + |
| 5010 | + //Recache the helper size |
| 5011 | + this._cacheHelperProportions(); |
| 5012 | + |
| 5013 | + //Prepare the droppable offsets |
| 5014 | + if ($.ui.ddmanager && !o.dropBehaviour) |
| 5015 | + $.ui.ddmanager.prepareOffsets(this, event); |
| 5016 | + |
| 5017 | + this.helper.addClass("ui-draggable-dragging"); |
| 5018 | + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position |
| 5019 | + return true; |
| 5020 | + }, |
| 5021 | + |
| 5022 | + _mouseDrag: function(event, noPropagation) { |
| 5023 | + |
| 5024 | + //Compute the helpers position |
| 5025 | + this.position = this._generatePosition(event); |
| 5026 | + this.positionAbs = this._convertPositionTo("absolute"); |
| 5027 | + |
| 5028 | + //Call plugins and callbacks and use the resulting position if something is returned |
| 5029 | + if (!noPropagation) { |
| 5030 | + var ui = this._uiHash(); |
| 5031 | + this._trigger('drag', event, ui); |
| 5032 | + this.position = ui.position; |
| 5033 | + } |
| 5034 | + |
| 5035 | + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; |
| 5036 | + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; |
| 5037 | + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); |
| 5038 | + |
| 5039 | + return false; |
| 5040 | + }, |
| 5041 | + |
| 5042 | + _mouseStop: function(event) { |
| 5043 | + |
| 5044 | + //If we are using droppables, inform the manager about the drop |
| 5045 | + var dropped = false; |
| 5046 | + if ($.ui.ddmanager && !this.options.dropBehaviour) |
| 5047 | + dropped = $.ui.ddmanager.drop(this, event); |
| 5048 | + |
| 5049 | + //if a drop comes from outside (a sortable) |
| 5050 | + if(this.dropped) { |
| 5051 | + dropped = this.dropped; |
| 5052 | + this.dropped = false; |
| 5053 | + } |
| 5054 | + |
| 5055 | + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { |
| 5056 | + var self = this; |
| 5057 | + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { |
| 5058 | + self._trigger("stop", event); |
| 5059 | + self._clear(); |
| 5060 | + }); |
| 5061 | + } else { |
| 5062 | + this._trigger("stop", event); |
| 5063 | + this._clear(); |
| 5064 | + } |
| 5065 | + |
| 5066 | + return false; |
| 5067 | + }, |
| 5068 | + |
| 5069 | + _getHandle: function(event) { |
| 5070 | + |
| 5071 | + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; |
| 5072 | + $(this.options.handle, this.element) |
| 5073 | + .find("*") |
| 5074 | + .andSelf() |
| 5075 | + .each(function() { |
| 5076 | + if(this == event.target) handle = true; |
| 5077 | + }); |
| 5078 | + |
| 5079 | + return handle; |
| 5080 | + |
| 5081 | + }, |
| 5082 | + |
| 5083 | + _createHelper: function(event) { |
| 5084 | + |
| 5085 | + var o = this.options; |
| 5086 | + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element); |
| 5087 | + |
| 5088 | + if(!helper.parents('body').length) |
| 5089 | + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); |
| 5090 | + |
| 5091 | + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) |
| 5092 | + helper.css("position", "absolute"); |
| 5093 | + |
| 5094 | + return helper; |
| 5095 | + |
| 5096 | + }, |
| 5097 | + |
| 5098 | + _adjustOffsetFromHelper: function(obj) { |
| 5099 | + if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left; |
| 5100 | + if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; |
| 5101 | + if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top; |
| 5102 | + if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; |
| 5103 | + }, |
| 5104 | + |
| 5105 | + _getParentOffset: function() { |
| 5106 | + |
| 5107 | + //Get the offsetParent and cache its position |
| 5108 | + this.offsetParent = this.helper.offsetParent(); |
| 5109 | + var po = this.offsetParent.offset(); |
| 5110 | + |
| 5111 | + // This is a special case where we need to modify a offset calculated on start, since the following happened: |
| 5112 | + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent |
| 5113 | + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that |
| 5114 | + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag |
| 5115 | + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { |
| 5116 | + po.left += this.scrollParent.scrollLeft(); |
| 5117 | + po.top += this.scrollParent.scrollTop(); |
| 5118 | + } |
| 5119 | + |
| 5120 | + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information |
| 5121 | + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix |
| 5122 | + po = { top: 0, left: 0 }; |
| 5123 | + |
| 5124 | + return { |
| 5125 | + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), |
| 5126 | + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) |
| 5127 | + }; |
| 5128 | + |
| 5129 | + }, |
| 5130 | + |
| 5131 | + _getRelativeOffset: function() { |
| 5132 | + |
| 5133 | + if(this.cssPosition == "relative") { |
| 5134 | + var p = this.element.position(); |
| 5135 | + return { |
| 5136 | + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), |
| 5137 | + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() |
| 5138 | + }; |
| 5139 | + } else { |
| 5140 | + return { top: 0, left: 0 }; |
| 5141 | + } |
| 5142 | + |
| 5143 | + }, |
| 5144 | + |
| 5145 | + _cacheMargins: function() { |
| 5146 | + this.margins = { |
| 5147 | + left: (parseInt(this.element.css("marginLeft"),10) || 0), |
| 5148 | + top: (parseInt(this.element.css("marginTop"),10) || 0) |
| 5149 | + }; |
| 5150 | + }, |
| 5151 | + |
| 5152 | + _cacheHelperProportions: function() { |
| 5153 | + this.helperProportions = { |
| 5154 | + width: this.helper.outerWidth(), |
| 5155 | + height: this.helper.outerHeight() |
| 5156 | + }; |
| 5157 | + }, |
| 5158 | + |
| 5159 | + _setContainment: function() { |
| 5160 | + |
| 5161 | + var o = this.options; |
| 5162 | + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; |
| 5163 | + if(o.containment == 'document' || o.containment == 'window') this.containment = [ |
| 5164 | + 0 - this.offset.relative.left - this.offset.parent.left, |
| 5165 | + 0 - this.offset.relative.top - this.offset.parent.top, |
| 5166 | + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, |
| 5167 | + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top |
| 5168 | + ]; |
| 5169 | + |
| 5170 | + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { |
| 5171 | + var ce = $(o.containment)[0]; if(!ce) return; |
| 5172 | + var co = $(o.containment).offset(); |
| 5173 | + var over = ($(ce).css("overflow") != 'hidden'); |
| 5174 | + |
| 5175 | + this.containment = [ |
| 5176 | + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, |
| 5177 | + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, |
| 5178 | + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, |
| 5179 | + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top |
| 5180 | + ]; |
| 5181 | + } else if(o.containment.constructor == Array) { |
| 5182 | + this.containment = o.containment; |
| 5183 | + } |
| 5184 | + |
| 5185 | + }, |
| 5186 | + |
| 5187 | + _convertPositionTo: function(d, pos) { |
| 5188 | + |
| 5189 | + if(!pos) pos = this.position; |
| 5190 | + var mod = d == "absolute" ? 1 : -1; |
| 5191 | + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); |
| 5192 | + |
| 5193 | + return { |
| 5194 | + top: ( |
| 5195 | + pos.top // The absolute mouse position |
| 5196 | + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent |
| 5197 | + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) |
| 5198 | + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) |
| 5199 | + ), |
| 5200 | + left: ( |
| 5201 | + pos.left // The absolute mouse position |
| 5202 | + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent |
| 5203 | + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) |
| 5204 | + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) |
| 5205 | + ) |
| 5206 | + }; |
| 5207 | + |
| 5208 | + }, |
| 5209 | + |
| 5210 | + _generatePosition: function(event) { |
| 5211 | + |
| 5212 | + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); |
| 5213 | + |
| 5214 | + // This is another very weird special case that only happens for relative elements: |
| 5215 | + // 1. If the css position is relative |
| 5216 | + // 2. and the scroll parent is the document or similar to the offset parent |
| 5217 | + // we have to refresh the relative offset during the scroll so there are no jumps |
| 5218 | + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { |
| 5219 | + this.offset.relative = this._getRelativeOffset(); |
| 5220 | + } |
| 5221 | + |
| 5222 | + var pageX = event.pageX; |
| 5223 | + var pageY = event.pageY; |
| 5224 | + |
| 5225 | + /* |
| 5226 | + * - Position constraining - |
| 5227 | + * Constrain the position to a mix of grid, containment. |
| 5228 | + */ |
| 5229 | + |
| 5230 | + if(this.originalPosition) { //If we are not dragging yet, we won't check for options |
| 5231 | + |
| 5232 | + if(this.containment) { |
| 5233 | + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; |
| 5234 | + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; |
| 5235 | + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; |
| 5236 | + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; |
| 5237 | + } |
| 5238 | + |
| 5239 | + if(o.grid) { |
| 5240 | + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; |
| 5241 | + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; |
| 5242 | + |
| 5243 | + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; |
| 5244 | + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; |
| 5245 | + } |
| 5246 | + |
| 5247 | + } |
| 5248 | + |
| 5249 | + return { |
| 5250 | + top: ( |
| 5251 | + pageY // The absolute mouse position |
| 5252 | + - this.offset.click.top // Click offset (relative to the element) |
| 5253 | + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent |
| 5254 | + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) |
| 5255 | + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) |
| 5256 | + ), |
| 5257 | + left: ( |
| 5258 | + pageX // The absolute mouse position |
| 5259 | + - this.offset.click.left // Click offset (relative to the element) |
| 5260 | + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent |
| 5261 | + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) |
| 5262 | + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) |
| 5263 | + ) |
| 5264 | + }; |
| 5265 | + |
| 5266 | + }, |
| 5267 | + |
| 5268 | + _clear: function() { |
| 5269 | + this.helper.removeClass("ui-draggable-dragging"); |
| 5270 | + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); |
| 5271 | + //if($.ui.ddmanager) $.ui.ddmanager.current = null; |
| 5272 | + this.helper = null; |
| 5273 | + this.cancelHelperRemoval = false; |
| 5274 | + }, |
| 5275 | + |
| 5276 | + // From now on bulk stuff - mainly helpers |
| 5277 | + |
| 5278 | + _trigger: function(type, event, ui) { |
| 5279 | + ui = ui || this._uiHash(); |
| 5280 | + $.ui.plugin.call(this, type, [event, ui]); |
| 5281 | + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins |
| 5282 | + return $.widget.prototype._trigger.call(this, type, event, ui); |
| 5283 | + }, |
| 5284 | + |
| 5285 | + plugins: {}, |
| 5286 | + |
| 5287 | + _uiHash: function(event) { |
| 5288 | + return { |
| 5289 | + helper: this.helper, |
| 5290 | + position: this.position, |
| 5291 | + absolutePosition: this.positionAbs, //deprecated |
| 5292 | + offset: this.positionAbs |
| 5293 | + }; |
| 5294 | + } |
| 5295 | + |
| 5296 | +})); |
| 5297 | + |
| 5298 | +$.extend($.ui.draggable, { |
| 5299 | + version: "1.7.2", |
| 5300 | + eventPrefix: "drag", |
| 5301 | + defaults: { |
| 5302 | + addClasses: true, |
| 5303 | + appendTo: "parent", |
| 5304 | + axis: false, |
| 5305 | + cancel: ":input,option", |
| 5306 | + connectToSortable: false, |
| 5307 | + containment: false, |
| 5308 | + cursor: "auto", |
| 5309 | + cursorAt: false, |
| 5310 | + delay: 0, |
| 5311 | + distance: 1, |
| 5312 | + grid: false, |
| 5313 | + handle: false, |
| 5314 | + helper: "original", |
| 5315 | + iframeFix: false, |
| 5316 | + opacity: false, |
| 5317 | + refreshPositions: false, |
| 5318 | + revert: false, |
| 5319 | + revertDuration: 500, |
| 5320 | + scope: "default", |
| 5321 | + scroll: true, |
| 5322 | + scrollSensitivity: 20, |
| 5323 | + scrollSpeed: 20, |
| 5324 | + snap: false, |
| 5325 | + snapMode: "both", |
| 5326 | + snapTolerance: 20, |
| 5327 | + stack: false, |
| 5328 | + zIndex: false |
| 5329 | + } |
| 5330 | +}); |
| 5331 | + |
| 5332 | +$.ui.plugin.add("draggable", "connectToSortable", { |
| 5333 | + start: function(event, ui) { |
| 5334 | + |
| 5335 | + var inst = $(this).data("draggable"), o = inst.options, |
| 5336 | + uiSortable = $.extend({}, ui, { item: inst.element }); |
| 5337 | + inst.sortables = []; |
| 5338 | + $(o.connectToSortable).each(function() { |
| 5339 | + var sortable = $.data(this, 'sortable'); |
| 5340 | + if (sortable && !sortable.options.disabled) { |
| 5341 | + inst.sortables.push({ |
| 5342 | + instance: sortable, |
| 5343 | + shouldRevert: sortable.options.revert |
| 5344 | + }); |
| 5345 | + sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache |
| 5346 | + sortable._trigger("activate", event, uiSortable); |
| 5347 | + } |
| 5348 | + }); |
| 5349 | + |
| 5350 | + }, |
| 5351 | + stop: function(event, ui) { |
| 5352 | + |
| 5353 | + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper |
| 5354 | + var inst = $(this).data("draggable"), |
| 5355 | + uiSortable = $.extend({}, ui, { item: inst.element }); |
| 5356 | + |
| 5357 | + $.each(inst.sortables, function() { |
| 5358 | + if(this.instance.isOver) { |
| 5359 | + |
| 5360 | + this.instance.isOver = 0; |
| 5361 | + |
| 5362 | + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance |
| 5363 | + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) |
| 5364 | + |
| 5365 | + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' |
| 5366 | + if(this.shouldRevert) this.instance.options.revert = true; |
| 5367 | + |
| 5368 | + //Trigger the stop of the sortable |
| 5369 | + this.instance._mouseStop(event); |
| 5370 | + |
| 5371 | + this.instance.options.helper = this.instance.options._helper; |
| 5372 | + |
| 5373 | + //If the helper has been the original item, restore properties in the sortable |
| 5374 | + if(inst.options.helper == 'original') |
| 5375 | + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); |
| 5376 | + |
| 5377 | + } else { |
| 5378 | + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance |
| 5379 | + this.instance._trigger("deactivate", event, uiSortable); |
| 5380 | + } |
| 5381 | + |
| 5382 | + }); |
| 5383 | + |
| 5384 | + }, |
| 5385 | + drag: function(event, ui) { |
| 5386 | + |
| 5387 | + var inst = $(this).data("draggable"), self = this; |
| 5388 | + |
| 5389 | + var checkPos = function(o) { |
| 5390 | + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; |
| 5391 | + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; |
| 5392 | + var itemHeight = o.height, itemWidth = o.width; |
| 5393 | + var itemTop = o.top, itemLeft = o.left; |
| 5394 | + |
| 5395 | + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); |
| 5396 | + }; |
| 5397 | + |
| 5398 | + $.each(inst.sortables, function(i) { |
| 5399 | + |
| 5400 | + //Copy over some variables to allow calling the sortable's native _intersectsWith |
| 5401 | + this.instance.positionAbs = inst.positionAbs; |
| 5402 | + this.instance.helperProportions = inst.helperProportions; |
| 5403 | + this.instance.offset.click = inst.offset.click; |
| 5404 | + |
| 5405 | + if(this.instance._intersectsWith(this.instance.containerCache)) { |
| 5406 | + |
| 5407 | + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once |
| 5408 | + if(!this.instance.isOver) { |
| 5409 | + |
| 5410 | + this.instance.isOver = 1; |
| 5411 | + //Now we fake the start of dragging for the sortable instance, |
| 5412 | + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem |
| 5413 | + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) |
| 5414 | + this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); |
| 5415 | + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it |
| 5416 | + this.instance.options.helper = function() { return ui.helper[0]; }; |
| 5417 | + |
| 5418 | + event.target = this.instance.currentItem[0]; |
| 5419 | + this.instance._mouseCapture(event, true); |
| 5420 | + this.instance._mouseStart(event, true, true); |
| 5421 | + |
| 5422 | + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes |
| 5423 | + this.instance.offset.click.top = inst.offset.click.top; |
| 5424 | + this.instance.offset.click.left = inst.offset.click.left; |
| 5425 | + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; |
| 5426 | + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; |
| 5427 | + |
| 5428 | + inst._trigger("toSortable", event); |
| 5429 | + inst.dropped = this.instance.element; //draggable revert needs that |
| 5430 | + //hack so receive/update callbacks work (mostly) |
| 5431 | + inst.currentItem = inst.element; |
| 5432 | + this.instance.fromOutside = inst; |
| 5433 | + |
| 5434 | + } |
| 5435 | + |
| 5436 | + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable |
| 5437 | + if(this.instance.currentItem) this.instance._mouseDrag(event); |
| 5438 | + |
| 5439 | + } else { |
| 5440 | + |
| 5441 | + //If it doesn't intersect with the sortable, and it intersected before, |
| 5442 | + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval |
| 5443 | + if(this.instance.isOver) { |
| 5444 | + |
| 5445 | + this.instance.isOver = 0; |
| 5446 | + this.instance.cancelHelperRemoval = true; |
| 5447 | + |
| 5448 | + //Prevent reverting on this forced stop |
| 5449 | + this.instance.options.revert = false; |
| 5450 | + |
| 5451 | + // The out event needs to be triggered independently |
| 5452 | + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); |
| 5453 | + |
| 5454 | + this.instance._mouseStop(event, true); |
| 5455 | + this.instance.options.helper = this.instance.options._helper; |
| 5456 | + |
| 5457 | + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size |
| 5458 | + this.instance.currentItem.remove(); |
| 5459 | + if(this.instance.placeholder) this.instance.placeholder.remove(); |
| 5460 | + |
| 5461 | + inst._trigger("fromSortable", event); |
| 5462 | + inst.dropped = false; //draggable revert needs that |
| 5463 | + } |
| 5464 | + |
| 5465 | + }; |
| 5466 | + |
| 5467 | + }); |
| 5468 | + |
| 5469 | + } |
| 5470 | +}); |
| 5471 | + |
| 5472 | +$.ui.plugin.add("draggable", "cursor", { |
| 5473 | + start: function(event, ui) { |
| 5474 | + var t = $('body'), o = $(this).data('draggable').options; |
| 5475 | + if (t.css("cursor")) o._cursor = t.css("cursor"); |
| 5476 | + t.css("cursor", o.cursor); |
| 5477 | + }, |
| 5478 | + stop: function(event, ui) { |
| 5479 | + var o = $(this).data('draggable').options; |
| 5480 | + if (o._cursor) $('body').css("cursor", o._cursor); |
| 5481 | + } |
| 5482 | +}); |
| 5483 | + |
| 5484 | +$.ui.plugin.add("draggable", "iframeFix", { |
| 5485 | + start: function(event, ui) { |
| 5486 | + var o = $(this).data('draggable').options; |
| 5487 | + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { |
| 5488 | + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') |
| 5489 | + .css({ |
| 5490 | + width: this.offsetWidth+"px", height: this.offsetHeight+"px", |
| 5491 | + position: "absolute", opacity: "0.001", zIndex: 1000 |
| 5492 | + }) |
| 5493 | + .css($(this).offset()) |
| 5494 | + .appendTo("body"); |
| 5495 | + }); |
| 5496 | + }, |
| 5497 | + stop: function(event, ui) { |
| 5498 | + $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers |
| 5499 | + } |
| 5500 | +}); |
| 5501 | + |
| 5502 | +$.ui.plugin.add("draggable", "opacity", { |
| 5503 | + start: function(event, ui) { |
| 5504 | + var t = $(ui.helper), o = $(this).data('draggable').options; |
| 5505 | + if(t.css("opacity")) o._opacity = t.css("opacity"); |
| 5506 | + t.css('opacity', o.opacity); |
| 5507 | + }, |
| 5508 | + stop: function(event, ui) { |
| 5509 | + var o = $(this).data('draggable').options; |
| 5510 | + if(o._opacity) $(ui.helper).css('opacity', o._opacity); |
| 5511 | + } |
| 5512 | +}); |
| 5513 | + |
| 5514 | +$.ui.plugin.add("draggable", "scroll", { |
| 5515 | + start: function(event, ui) { |
| 5516 | + var i = $(this).data("draggable"); |
| 5517 | + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); |
| 5518 | + }, |
| 5519 | + drag: function(event, ui) { |
| 5520 | + |
| 5521 | + var i = $(this).data("draggable"), o = i.options, scrolled = false; |
| 5522 | + |
| 5523 | + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { |
| 5524 | + |
| 5525 | + if(!o.axis || o.axis != 'x') { |
| 5526 | + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) |
| 5527 | + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; |
| 5528 | + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) |
| 5529 | + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; |
| 5530 | + } |
| 5531 | + |
| 5532 | + if(!o.axis || o.axis != 'y') { |
| 5533 | + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) |
| 5534 | + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; |
| 5535 | + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) |
| 5536 | + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; |
| 5537 | + } |
| 5538 | + |
| 5539 | + } else { |
| 5540 | + |
| 5541 | + if(!o.axis || o.axis != 'x') { |
| 5542 | + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) |
| 5543 | + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); |
| 5544 | + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) |
| 5545 | + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); |
| 5546 | + } |
| 5547 | + |
| 5548 | + if(!o.axis || o.axis != 'y') { |
| 5549 | + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) |
| 5550 | + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); |
| 5551 | + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) |
| 5552 | + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); |
| 5553 | + } |
| 5554 | + |
| 5555 | + } |
| 5556 | + |
| 5557 | + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) |
| 5558 | + $.ui.ddmanager.prepareOffsets(i, event); |
| 5559 | + |
| 5560 | + } |
| 5561 | +}); |
| 5562 | + |
| 5563 | +$.ui.plugin.add("draggable", "snap", { |
| 5564 | + start: function(event, ui) { |
| 5565 | + |
| 5566 | + var i = $(this).data("draggable"), o = i.options; |
| 5567 | + i.snapElements = []; |
| 5568 | + |
| 5569 | + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { |
| 5570 | + var $t = $(this); var $o = $t.offset(); |
| 5571 | + if(this != i.element[0]) i.snapElements.push({ |
| 5572 | + item: this, |
| 5573 | + width: $t.outerWidth(), height: $t.outerHeight(), |
| 5574 | + top: $o.top, left: $o.left |
| 5575 | + }); |
| 5576 | + }); |
| 5577 | + |
| 5578 | + }, |
| 5579 | + drag: function(event, ui) { |
| 5580 | + |
| 5581 | + var inst = $(this).data("draggable"), o = inst.options; |
| 5582 | + var d = o.snapTolerance; |
| 5583 | + |
| 5584 | + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, |
| 5585 | + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; |
| 5586 | + |
| 5587 | + for (var i = inst.snapElements.length - 1; i >= 0; i--){ |
| 5588 | + |
| 5589 | + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, |
| 5590 | + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; |
| 5591 | + |
| 5592 | + //Yes, I know, this is insane ;) |
| 5593 | + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { |
| 5594 | + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); |
| 5595 | + inst.snapElements[i].snapping = false; |
| 5596 | + continue; |
| 5597 | + } |
| 5598 | + |
| 5599 | + if(o.snapMode != 'inner') { |
| 5600 | + var ts = Math.abs(t - y2) <= d; |
| 5601 | + var bs = Math.abs(b - y1) <= d; |
| 5602 | + var ls = Math.abs(l - x2) <= d; |
| 5603 | + var rs = Math.abs(r - x1) <= d; |
| 5604 | + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; |
| 5605 | + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; |
| 5606 | + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; |
| 5607 | + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; |
| 5608 | + } |
| 5609 | + |
| 5610 | + var first = (ts || bs || ls || rs); |
| 5611 | + |
| 5612 | + if(o.snapMode != 'outer') { |
| 5613 | + var ts = Math.abs(t - y1) <= d; |
| 5614 | + var bs = Math.abs(b - y2) <= d; |
| 5615 | + var ls = Math.abs(l - x1) <= d; |
| 5616 | + var rs = Math.abs(r - x2) <= d; |
| 5617 | + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; |
| 5618 | + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; |
| 5619 | + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; |
| 5620 | + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; |
| 5621 | + } |
| 5622 | + |
| 5623 | + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) |
| 5624 | + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); |
| 5625 | + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); |
| 5626 | + |
| 5627 | + }; |
| 5628 | + |
| 5629 | + } |
| 5630 | +}); |
| 5631 | + |
| 5632 | +$.ui.plugin.add("draggable", "stack", { |
| 5633 | + start: function(event, ui) { |
| 5634 | + |
| 5635 | + var o = $(this).data("draggable").options; |
| 5636 | + |
| 5637 | + var group = $.makeArray($(o.stack.group)).sort(function(a,b) { |
| 5638 | + return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min); |
| 5639 | + }); |
| 5640 | + |
| 5641 | + $(group).each(function(i) { |
| 5642 | + this.style.zIndex = o.stack.min + i; |
| 5643 | + }); |
| 5644 | + |
| 5645 | + this[0].style.zIndex = o.stack.min + group.length; |
| 5646 | + |
| 5647 | + } |
| 5648 | +}); |
| 5649 | + |
| 5650 | +$.ui.plugin.add("draggable", "zIndex", { |
| 5651 | + start: function(event, ui) { |
| 5652 | + var t = $(ui.helper), o = $(this).data("draggable").options; |
| 5653 | + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); |
| 5654 | + t.css('zIndex', o.zIndex); |
| 5655 | + }, |
| 5656 | + stop: function(event, ui) { |
| 5657 | + var o = $(this).data("draggable").options; |
| 5658 | + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); |
| 5659 | + } |
| 5660 | +}); |
| 5661 | + |
| 5662 | +})(jQuery); |
| 5663 | +/* |
| 5664 | + * jQuery UI Resizable 1.7.2 |
| 5665 | + * |
| 5666 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 5667 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 5668 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 5669 | + * |
| 5670 | + * http://docs.jquery.com/UI/Resizables |
| 5671 | + * |
| 5672 | + * Depends: |
| 5673 | + * ui.core.js |
| 5674 | + */ |
| 5675 | +(function($) { |
| 5676 | + |
| 5677 | +$.widget("ui.resizable", $.extend({}, $.ui.mouse, { |
| 5678 | + |
| 5679 | + _init: function() { |
| 5680 | + |
| 5681 | + var self = this, o = this.options; |
| 5682 | + this.element.addClass("ui-resizable"); |
| 5683 | + |
| 5684 | + $.extend(this, { |
| 5685 | + _aspectRatio: !!(o.aspectRatio), |
| 5686 | + aspectRatio: o.aspectRatio, |
| 5687 | + originalElement: this.element, |
| 5688 | + _proportionallyResizeElements: [], |
| 5689 | + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null |
| 5690 | + }); |
| 5691 | + |
| 5692 | + //Wrap the element if it cannot hold child nodes |
| 5693 | + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { |
| 5694 | + |
| 5695 | + //Opera fix for relative positioning |
| 5696 | + if (/relative/.test(this.element.css('position')) && $.browser.opera) |
| 5697 | + this.element.css({ position: 'relative', top: 'auto', left: 'auto' }); |
| 5698 | + |
| 5699 | + //Create a wrapper element and set the wrapper to the new current internal element |
| 5700 | + this.element.wrap( |
| 5701 | + $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ |
| 5702 | + position: this.element.css('position'), |
| 5703 | + width: this.element.outerWidth(), |
| 5704 | + height: this.element.outerHeight(), |
| 5705 | + top: this.element.css('top'), |
| 5706 | + left: this.element.css('left') |
| 5707 | + }) |
| 5708 | + ); |
| 5709 | + |
| 5710 | + //Overwrite the original this.element |
| 5711 | + this.element = this.element.parent().data( |
| 5712 | + "resizable", this.element.data('resizable') |
| 5713 | + ); |
| 5714 | + |
| 5715 | + this.elementIsWrapper = true; |
| 5716 | + |
| 5717 | + //Move margins to the wrapper |
| 5718 | + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); |
| 5719 | + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); |
| 5720 | + |
| 5721 | + //Prevent Safari textarea resize |
| 5722 | + this.originalResizeStyle = this.originalElement.css('resize'); |
| 5723 | + this.originalElement.css('resize', 'none'); |
| 5724 | + |
| 5725 | + //Push the actual element to our proportionallyResize internal array |
| 5726 | + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); |
| 5727 | + |
| 5728 | + // avoid IE jump (hard set the margin) |
| 5729 | + this.originalElement.css({ margin: this.originalElement.css('margin') }); |
| 5730 | + |
| 5731 | + // fix handlers offset |
| 5732 | + this._proportionallyResize(); |
| 5733 | + |
| 5734 | + } |
| 5735 | + |
| 5736 | + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); |
| 5737 | + if(this.handles.constructor == String) { |
| 5738 | + |
| 5739 | + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; |
| 5740 | + var n = this.handles.split(","); this.handles = {}; |
| 5741 | + |
| 5742 | + for(var i = 0; i < n.length; i++) { |
| 5743 | + |
| 5744 | + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; |
| 5745 | + var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); |
| 5746 | + |
| 5747 | + // increase zIndex of sw, se, ne, nw axis |
| 5748 | + //TODO : this modifies original option |
| 5749 | + if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex }); |
| 5750 | + |
| 5751 | + //TODO : What's going on here? |
| 5752 | + if ('se' == handle) { |
| 5753 | + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); |
| 5754 | + }; |
| 5755 | + |
| 5756 | + //Insert into internal handles object and append to element |
| 5757 | + this.handles[handle] = '.ui-resizable-'+handle; |
| 5758 | + this.element.append(axis); |
| 5759 | + } |
| 5760 | + |
| 5761 | + } |
| 5762 | + |
| 5763 | + this._renderAxis = function(target) { |
| 5764 | + |
| 5765 | + target = target || this.element; |
| 5766 | + |
| 5767 | + for(var i in this.handles) { |
| 5768 | + |
| 5769 | + if(this.handles[i].constructor == String) |
| 5770 | + this.handles[i] = $(this.handles[i], this.element).show(); |
| 5771 | + |
| 5772 | + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) |
| 5773 | + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { |
| 5774 | + |
| 5775 | + var axis = $(this.handles[i], this.element), padWrapper = 0; |
| 5776 | + |
| 5777 | + //Checking the correct pad and border |
| 5778 | + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); |
| 5779 | + |
| 5780 | + //The padding type i have to apply... |
| 5781 | + var padPos = [ 'padding', |
| 5782 | + /ne|nw|n/.test(i) ? 'Top' : |
| 5783 | + /se|sw|s/.test(i) ? 'Bottom' : |
| 5784 | + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); |
| 5785 | + |
| 5786 | + target.css(padPos, padWrapper); |
| 5787 | + |
| 5788 | + this._proportionallyResize(); |
| 5789 | + |
| 5790 | + } |
| 5791 | + |
| 5792 | + //TODO: What's that good for? There's not anything to be executed left |
| 5793 | + if(!$(this.handles[i]).length) |
| 5794 | + continue; |
| 5795 | + |
| 5796 | + } |
| 5797 | + }; |
| 5798 | + |
| 5799 | + //TODO: make renderAxis a prototype function |
| 5800 | + this._renderAxis(this.element); |
| 5801 | + |
| 5802 | + this._handles = $('.ui-resizable-handle', this.element) |
| 5803 | + .disableSelection(); |
| 5804 | + |
| 5805 | + //Matching axis name |
| 5806 | + this._handles.mouseover(function() { |
| 5807 | + if (!self.resizing) { |
| 5808 | + if (this.className) |
| 5809 | + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); |
| 5810 | + //Axis, default = se |
| 5811 | + self.axis = axis && axis[1] ? axis[1] : 'se'; |
| 5812 | + } |
| 5813 | + }); |
| 5814 | + |
| 5815 | + //If we want to auto hide the elements |
| 5816 | + if (o.autoHide) { |
| 5817 | + this._handles.hide(); |
| 5818 | + $(this.element) |
| 5819 | + .addClass("ui-resizable-autohide") |
| 5820 | + .hover(function() { |
| 5821 | + $(this).removeClass("ui-resizable-autohide"); |
| 5822 | + self._handles.show(); |
| 5823 | + }, |
| 5824 | + function(){ |
| 5825 | + if (!self.resizing) { |
| 5826 | + $(this).addClass("ui-resizable-autohide"); |
| 5827 | + self._handles.hide(); |
| 5828 | + } |
| 5829 | + }); |
| 5830 | + } |
| 5831 | + |
| 5832 | + //Initialize the mouse interaction |
| 5833 | + this._mouseInit(); |
| 5834 | + |
| 5835 | + }, |
| 5836 | + |
| 5837 | + destroy: function() { |
| 5838 | + |
| 5839 | + this._mouseDestroy(); |
| 5840 | + |
| 5841 | + var _destroy = function(exp) { |
| 5842 | + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") |
| 5843 | + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); |
| 5844 | + }; |
| 5845 | + |
| 5846 | + //TODO: Unwrap at same DOM position |
| 5847 | + if (this.elementIsWrapper) { |
| 5848 | + _destroy(this.element); |
| 5849 | + var wrapper = this.element; |
| 5850 | + wrapper.parent().append( |
| 5851 | + this.originalElement.css({ |
| 5852 | + position: wrapper.css('position'), |
| 5853 | + width: wrapper.outerWidth(), |
| 5854 | + height: wrapper.outerHeight(), |
| 5855 | + top: wrapper.css('top'), |
| 5856 | + left: wrapper.css('left') |
| 5857 | + }) |
| 5858 | + ).end().remove(); |
| 5859 | + } |
| 5860 | + |
| 5861 | + this.originalElement.css('resize', this.originalResizeStyle); |
| 5862 | + _destroy(this.originalElement); |
| 5863 | + |
| 5864 | + }, |
| 5865 | + |
| 5866 | + _mouseCapture: function(event) { |
| 5867 | + |
| 5868 | + var handle = false; |
| 5869 | + for(var i in this.handles) { |
| 5870 | + if($(this.handles[i])[0] == event.target) handle = true; |
| 5871 | + } |
| 5872 | + |
| 5873 | + return this.options.disabled || !!handle; |
| 5874 | + |
| 5875 | + }, |
| 5876 | + |
| 5877 | + _mouseStart: function(event) { |
| 5878 | + |
| 5879 | + var o = this.options, iniPos = this.element.position(), el = this.element; |
| 5880 | + |
| 5881 | + this.resizing = true; |
| 5882 | + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; |
| 5883 | + |
| 5884 | + // bugfix for http://dev.jquery.com/ticket/1749 |
| 5885 | + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { |
| 5886 | + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); |
| 5887 | + } |
| 5888 | + |
| 5889 | + //Opera fixing relative position |
| 5890 | + if ($.browser.opera && (/relative/).test(el.css('position'))) |
| 5891 | + el.css({ position: 'relative', top: 'auto', left: 'auto' }); |
| 5892 | + |
| 5893 | + this._renderProxy(); |
| 5894 | + |
| 5895 | + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); |
| 5896 | + |
| 5897 | + if (o.containment) { |
| 5898 | + curleft += $(o.containment).scrollLeft() || 0; |
| 5899 | + curtop += $(o.containment).scrollTop() || 0; |
| 5900 | + } |
| 5901 | + |
| 5902 | + //Store needed variables |
| 5903 | + this.offset = this.helper.offset(); |
| 5904 | + this.position = { left: curleft, top: curtop }; |
| 5905 | + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; |
| 5906 | + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; |
| 5907 | + this.originalPosition = { left: curleft, top: curtop }; |
| 5908 | + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; |
| 5909 | + this.originalMousePosition = { left: event.pageX, top: event.pageY }; |
| 5910 | + |
| 5911 | + //Aspect Ratio |
| 5912 | + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); |
| 5913 | + |
| 5914 | + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); |
| 5915 | + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); |
| 5916 | + |
| 5917 | + el.addClass("ui-resizable-resizing"); |
| 5918 | + this._propagate("start", event); |
| 5919 | + return true; |
| 5920 | + }, |
| 5921 | + |
| 5922 | + _mouseDrag: function(event) { |
| 5923 | + |
| 5924 | + //Increase performance, avoid regex |
| 5925 | + var el = this.helper, o = this.options, props = {}, |
| 5926 | + self = this, smp = this.originalMousePosition, a = this.axis; |
| 5927 | + |
| 5928 | + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; |
| 5929 | + var trigger = this._change[a]; |
| 5930 | + if (!trigger) return false; |
| 5931 | + |
| 5932 | + // Calculate the attrs that will be change |
| 5933 | + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; |
| 5934 | + |
| 5935 | + if (this._aspectRatio || event.shiftKey) |
| 5936 | + data = this._updateRatio(data, event); |
| 5937 | + |
| 5938 | + data = this._respectSize(data, event); |
| 5939 | + |
| 5940 | + // plugins callbacks need to be called first |
| 5941 | + this._propagate("resize", event); |
| 5942 | + |
| 5943 | + el.css({ |
| 5944 | + top: this.position.top + "px", left: this.position.left + "px", |
| 5945 | + width: this.size.width + "px", height: this.size.height + "px" |
| 5946 | + }); |
| 5947 | + |
| 5948 | + if (!this._helper && this._proportionallyResizeElements.length) |
| 5949 | + this._proportionallyResize(); |
| 5950 | + |
| 5951 | + this._updateCache(data); |
| 5952 | + |
| 5953 | + // calling the user callback at the end |
| 5954 | + this._trigger('resize', event, this.ui()); |
| 5955 | + |
| 5956 | + return false; |
| 5957 | + }, |
| 5958 | + |
| 5959 | + _mouseStop: function(event) { |
| 5960 | + |
| 5961 | + this.resizing = false; |
| 5962 | + var o = this.options, self = this; |
| 5963 | + |
| 5964 | + if(this._helper) { |
| 5965 | + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), |
| 5966 | + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, |
| 5967 | + soffsetw = ista ? 0 : self.sizeDiff.width; |
| 5968 | + |
| 5969 | + var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, |
| 5970 | + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, |
| 5971 | + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; |
| 5972 | + |
| 5973 | + if (!o.animate) |
| 5974 | + this.element.css($.extend(s, { top: top, left: left })); |
| 5975 | + |
| 5976 | + self.helper.height(self.size.height); |
| 5977 | + self.helper.width(self.size.width); |
| 5978 | + |
| 5979 | + if (this._helper && !o.animate) this._proportionallyResize(); |
| 5980 | + } |
| 5981 | + |
| 5982 | + $('body').css('cursor', 'auto'); |
| 5983 | + |
| 5984 | + this.element.removeClass("ui-resizable-resizing"); |
| 5985 | + |
| 5986 | + this._propagate("stop", event); |
| 5987 | + |
| 5988 | + if (this._helper) this.helper.remove(); |
| 5989 | + return false; |
| 5990 | + |
| 5991 | + }, |
| 5992 | + |
| 5993 | + _updateCache: function(data) { |
| 5994 | + var o = this.options; |
| 5995 | + this.offset = this.helper.offset(); |
| 5996 | + if (isNumber(data.left)) this.position.left = data.left; |
| 5997 | + if (isNumber(data.top)) this.position.top = data.top; |
| 5998 | + if (isNumber(data.height)) this.size.height = data.height; |
| 5999 | + if (isNumber(data.width)) this.size.width = data.width; |
| 6000 | + }, |
| 6001 | + |
| 6002 | + _updateRatio: function(data, event) { |
| 6003 | + |
| 6004 | + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; |
| 6005 | + |
| 6006 | + if (data.height) data.width = (csize.height * this.aspectRatio); |
| 6007 | + else if (data.width) data.height = (csize.width / this.aspectRatio); |
| 6008 | + |
| 6009 | + if (a == 'sw') { |
| 6010 | + data.left = cpos.left + (csize.width - data.width); |
| 6011 | + data.top = null; |
| 6012 | + } |
| 6013 | + if (a == 'nw') { |
| 6014 | + data.top = cpos.top + (csize.height - data.height); |
| 6015 | + data.left = cpos.left + (csize.width - data.width); |
| 6016 | + } |
| 6017 | + |
| 6018 | + return data; |
| 6019 | + }, |
| 6020 | + |
| 6021 | + _respectSize: function(data, event) { |
| 6022 | + |
| 6023 | + var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, |
| 6024 | + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), |
| 6025 | + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); |
| 6026 | + |
| 6027 | + if (isminw) data.width = o.minWidth; |
| 6028 | + if (isminh) data.height = o.minHeight; |
| 6029 | + if (ismaxw) data.width = o.maxWidth; |
| 6030 | + if (ismaxh) data.height = o.maxHeight; |
| 6031 | + |
| 6032 | + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; |
| 6033 | + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); |
| 6034 | + |
| 6035 | + if (isminw && cw) data.left = dw - o.minWidth; |
| 6036 | + if (ismaxw && cw) data.left = dw - o.maxWidth; |
| 6037 | + if (isminh && ch) data.top = dh - o.minHeight; |
| 6038 | + if (ismaxh && ch) data.top = dh - o.maxHeight; |
| 6039 | + |
| 6040 | + // fixing jump error on top/left - bug #2330 |
| 6041 | + var isNotwh = !data.width && !data.height; |
| 6042 | + if (isNotwh && !data.left && data.top) data.top = null; |
| 6043 | + else if (isNotwh && !data.top && data.left) data.left = null; |
| 6044 | + |
| 6045 | + return data; |
| 6046 | + }, |
| 6047 | + |
| 6048 | + _proportionallyResize: function() { |
| 6049 | + |
| 6050 | + var o = this.options; |
| 6051 | + if (!this._proportionallyResizeElements.length) return; |
| 6052 | + var element = this.helper || this.element; |
| 6053 | + |
| 6054 | + for (var i=0; i < this._proportionallyResizeElements.length; i++) { |
| 6055 | + |
| 6056 | + var prel = this._proportionallyResizeElements[i]; |
| 6057 | + |
| 6058 | + if (!this.borderDif) { |
| 6059 | + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], |
| 6060 | + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; |
| 6061 | + |
| 6062 | + this.borderDif = $.map(b, function(v, i) { |
| 6063 | + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; |
| 6064 | + return border + padding; |
| 6065 | + }); |
| 6066 | + } |
| 6067 | + |
| 6068 | + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) |
| 6069 | + continue; |
| 6070 | + |
| 6071 | + prel.css({ |
| 6072 | + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, |
| 6073 | + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 |
| 6074 | + }); |
| 6075 | + |
| 6076 | + }; |
| 6077 | + |
| 6078 | + }, |
| 6079 | + |
| 6080 | + _renderProxy: function() { |
| 6081 | + |
| 6082 | + var el = this.element, o = this.options; |
| 6083 | + this.elementOffset = el.offset(); |
| 6084 | + |
| 6085 | + if(this._helper) { |
| 6086 | + |
| 6087 | + this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); |
| 6088 | + |
| 6089 | + // fix ie6 offset TODO: This seems broken |
| 6090 | + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), |
| 6091 | + pxyoffset = ( ie6 ? 2 : -1 ); |
| 6092 | + |
| 6093 | + this.helper.addClass(this._helper).css({ |
| 6094 | + width: this.element.outerWidth() + pxyoffset, |
| 6095 | + height: this.element.outerHeight() + pxyoffset, |
| 6096 | + position: 'absolute', |
| 6097 | + left: this.elementOffset.left - ie6offset +'px', |
| 6098 | + top: this.elementOffset.top - ie6offset +'px', |
| 6099 | + zIndex: ++o.zIndex //TODO: Don't modify option |
| 6100 | + }); |
| 6101 | + |
| 6102 | + this.helper |
| 6103 | + .appendTo("body") |
| 6104 | + .disableSelection(); |
| 6105 | + |
| 6106 | + } else { |
| 6107 | + this.helper = this.element; |
| 6108 | + } |
| 6109 | + |
| 6110 | + }, |
| 6111 | + |
| 6112 | + _change: { |
| 6113 | + e: function(event, dx, dy) { |
| 6114 | + return { width: this.originalSize.width + dx }; |
| 6115 | + }, |
| 6116 | + w: function(event, dx, dy) { |
| 6117 | + var o = this.options, cs = this.originalSize, sp = this.originalPosition; |
| 6118 | + return { left: sp.left + dx, width: cs.width - dx }; |
| 6119 | + }, |
| 6120 | + n: function(event, dx, dy) { |
| 6121 | + var o = this.options, cs = this.originalSize, sp = this.originalPosition; |
| 6122 | + return { top: sp.top + dy, height: cs.height - dy }; |
| 6123 | + }, |
| 6124 | + s: function(event, dx, dy) { |
| 6125 | + return { height: this.originalSize.height + dy }; |
| 6126 | + }, |
| 6127 | + se: function(event, dx, dy) { |
| 6128 | + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); |
| 6129 | + }, |
| 6130 | + sw: function(event, dx, dy) { |
| 6131 | + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); |
| 6132 | + }, |
| 6133 | + ne: function(event, dx, dy) { |
| 6134 | + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); |
| 6135 | + }, |
| 6136 | + nw: function(event, dx, dy) { |
| 6137 | + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); |
| 6138 | + } |
| 6139 | + }, |
| 6140 | + |
| 6141 | + _propagate: function(n, event) { |
| 6142 | + $.ui.plugin.call(this, n, [event, this.ui()]); |
| 6143 | + (n != "resize" && this._trigger(n, event, this.ui())); |
| 6144 | + }, |
| 6145 | + |
| 6146 | + plugins: {}, |
| 6147 | + |
| 6148 | + ui: function() { |
| 6149 | + return { |
| 6150 | + originalElement: this.originalElement, |
| 6151 | + element: this.element, |
| 6152 | + helper: this.helper, |
| 6153 | + position: this.position, |
| 6154 | + size: this.size, |
| 6155 | + originalSize: this.originalSize, |
| 6156 | + originalPosition: this.originalPosition |
| 6157 | + }; |
| 6158 | + } |
| 6159 | + |
| 6160 | +})); |
| 6161 | + |
| 6162 | +$.extend($.ui.resizable, { |
| 6163 | + version: "1.7.2", |
| 6164 | + eventPrefix: "resize", |
| 6165 | + defaults: { |
| 6166 | + alsoResize: false, |
| 6167 | + animate: false, |
| 6168 | + animateDuration: "slow", |
| 6169 | + animateEasing: "swing", |
| 6170 | + aspectRatio: false, |
| 6171 | + autoHide: false, |
| 6172 | + cancel: ":input,option", |
| 6173 | + containment: false, |
| 6174 | + delay: 0, |
| 6175 | + distance: 1, |
| 6176 | + ghost: false, |
| 6177 | + grid: false, |
| 6178 | + handles: "e,s,se", |
| 6179 | + helper: false, |
| 6180 | + maxHeight: null, |
| 6181 | + maxWidth: null, |
| 6182 | + minHeight: 10, |
| 6183 | + minWidth: 10, |
| 6184 | + zIndex: 1000 |
| 6185 | + } |
| 6186 | +}); |
| 6187 | + |
| 6188 | +/* |
| 6189 | + * Resizable Extensions |
| 6190 | + */ |
| 6191 | + |
| 6192 | +$.ui.plugin.add("resizable", "alsoResize", { |
| 6193 | + |
| 6194 | + start: function(event, ui) { |
| 6195 | + |
| 6196 | + var self = $(this).data("resizable"), o = self.options; |
| 6197 | + |
| 6198 | + _store = function(exp) { |
| 6199 | + $(exp).each(function() { |
| 6200 | + $(this).data("resizable-alsoresize", { |
| 6201 | + width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10), |
| 6202 | + left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10) |
| 6203 | + }); |
| 6204 | + }); |
| 6205 | + }; |
| 6206 | + |
| 6207 | + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { |
| 6208 | + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } |
| 6209 | + else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); } |
| 6210 | + }else{ |
| 6211 | + _store(o.alsoResize); |
| 6212 | + } |
| 6213 | + }, |
| 6214 | + |
| 6215 | + resize: function(event, ui){ |
| 6216 | + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; |
| 6217 | + |
| 6218 | + var delta = { |
| 6219 | + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, |
| 6220 | + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 |
| 6221 | + }, |
| 6222 | + |
| 6223 | + _alsoResize = function(exp, c) { |
| 6224 | + $(exp).each(function() { |
| 6225 | + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left']; |
| 6226 | + |
| 6227 | + $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) { |
| 6228 | + var sum = (start[prop]||0) + (delta[prop]||0); |
| 6229 | + if (sum && sum >= 0) |
| 6230 | + style[prop] = sum || null; |
| 6231 | + }); |
| 6232 | + |
| 6233 | + //Opera fixing relative position |
| 6234 | + if (/relative/.test(el.css('position')) && $.browser.opera) { |
| 6235 | + self._revertToRelativePosition = true; |
| 6236 | + el.css({ position: 'absolute', top: 'auto', left: 'auto' }); |
| 6237 | + } |
| 6238 | + |
| 6239 | + el.css(style); |
| 6240 | + }); |
| 6241 | + }; |
| 6242 | + |
| 6243 | + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { |
| 6244 | + $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); }); |
| 6245 | + }else{ |
| 6246 | + _alsoResize(o.alsoResize); |
| 6247 | + } |
| 6248 | + }, |
| 6249 | + |
| 6250 | + stop: function(event, ui){ |
| 6251 | + var self = $(this).data("resizable"); |
| 6252 | + |
| 6253 | + //Opera fixing relative position |
| 6254 | + if (self._revertToRelativePosition && $.browser.opera) { |
| 6255 | + self._revertToRelativePosition = false; |
| 6256 | + el.css({ position: 'relative' }); |
| 6257 | + } |
| 6258 | + |
| 6259 | + $(this).removeData("resizable-alsoresize-start"); |
| 6260 | + } |
| 6261 | +}); |
| 6262 | + |
| 6263 | +$.ui.plugin.add("resizable", "animate", { |
| 6264 | + |
| 6265 | + stop: function(event, ui) { |
| 6266 | + var self = $(this).data("resizable"), o = self.options; |
| 6267 | + |
| 6268 | + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), |
| 6269 | + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, |
| 6270 | + soffsetw = ista ? 0 : self.sizeDiff.width; |
| 6271 | + |
| 6272 | + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, |
| 6273 | + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, |
| 6274 | + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; |
| 6275 | + |
| 6276 | + self.element.animate( |
| 6277 | + $.extend(style, top && left ? { top: top, left: left } : {}), { |
| 6278 | + duration: o.animateDuration, |
| 6279 | + easing: o.animateEasing, |
| 6280 | + step: function() { |
| 6281 | + |
| 6282 | + var data = { |
| 6283 | + width: parseInt(self.element.css('width'), 10), |
| 6284 | + height: parseInt(self.element.css('height'), 10), |
| 6285 | + top: parseInt(self.element.css('top'), 10), |
| 6286 | + left: parseInt(self.element.css('left'), 10) |
| 6287 | + }; |
| 6288 | + |
| 6289 | + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); |
| 6290 | + |
| 6291 | + // propagating resize, and updating values for each animation step |
| 6292 | + self._updateCache(data); |
| 6293 | + self._propagate("resize", event); |
| 6294 | + |
| 6295 | + } |
| 6296 | + } |
| 6297 | + ); |
| 6298 | + } |
| 6299 | + |
| 6300 | +}); |
| 6301 | + |
| 6302 | +$.ui.plugin.add("resizable", "containment", { |
| 6303 | + |
| 6304 | + start: function(event, ui) { |
| 6305 | + var self = $(this).data("resizable"), o = self.options, el = self.element; |
| 6306 | + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; |
| 6307 | + if (!ce) return; |
| 6308 | + |
| 6309 | + self.containerElement = $(ce); |
| 6310 | + |
| 6311 | + if (/document/.test(oc) || oc == document) { |
| 6312 | + self.containerOffset = { left: 0, top: 0 }; |
| 6313 | + self.containerPosition = { left: 0, top: 0 }; |
| 6314 | + |
| 6315 | + self.parentData = { |
| 6316 | + element: $(document), left: 0, top: 0, |
| 6317 | + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight |
| 6318 | + }; |
| 6319 | + } |
| 6320 | + |
| 6321 | + // i'm a node, so compute top, left, right, bottom |
| 6322 | + else { |
| 6323 | + var element = $(ce), p = []; |
| 6324 | + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); |
| 6325 | + |
| 6326 | + self.containerOffset = element.offset(); |
| 6327 | + self.containerPosition = element.position(); |
| 6328 | + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; |
| 6329 | + |
| 6330 | + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, |
| 6331 | + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); |
| 6332 | + |
| 6333 | + self.parentData = { |
| 6334 | + element: ce, left: co.left, top: co.top, width: width, height: height |
| 6335 | + }; |
| 6336 | + } |
| 6337 | + }, |
| 6338 | + |
| 6339 | + resize: function(event, ui) { |
| 6340 | + var self = $(this).data("resizable"), o = self.options, |
| 6341 | + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, |
| 6342 | + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; |
| 6343 | + |
| 6344 | + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; |
| 6345 | + |
| 6346 | + if (cp.left < (self._helper ? co.left : 0)) { |
| 6347 | + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); |
| 6348 | + if (pRatio) self.size.height = self.size.width / o.aspectRatio; |
| 6349 | + self.position.left = o.helper ? co.left : 0; |
| 6350 | + } |
| 6351 | + |
| 6352 | + if (cp.top < (self._helper ? co.top : 0)) { |
| 6353 | + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); |
| 6354 | + if (pRatio) self.size.width = self.size.height * o.aspectRatio; |
| 6355 | + self.position.top = self._helper ? co.top : 0; |
| 6356 | + } |
| 6357 | + |
| 6358 | + self.offset.left = self.parentData.left+self.position.left; |
| 6359 | + self.offset.top = self.parentData.top+self.position.top; |
| 6360 | + |
| 6361 | + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), |
| 6362 | + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); |
| 6363 | + |
| 6364 | + var isParent = self.containerElement.get(0) == self.element.parent().get(0), |
| 6365 | + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); |
| 6366 | + |
| 6367 | + if(isParent && isOffsetRelative) woset -= self.parentData.left; |
| 6368 | + |
| 6369 | + if (woset + self.size.width >= self.parentData.width) { |
| 6370 | + self.size.width = self.parentData.width - woset; |
| 6371 | + if (pRatio) self.size.height = self.size.width / self.aspectRatio; |
| 6372 | + } |
| 6373 | + |
| 6374 | + if (hoset + self.size.height >= self.parentData.height) { |
| 6375 | + self.size.height = self.parentData.height - hoset; |
| 6376 | + if (pRatio) self.size.width = self.size.height * self.aspectRatio; |
| 6377 | + } |
| 6378 | + }, |
| 6379 | + |
| 6380 | + stop: function(event, ui){ |
| 6381 | + var self = $(this).data("resizable"), o = self.options, cp = self.position, |
| 6382 | + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; |
| 6383 | + |
| 6384 | + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; |
| 6385 | + |
| 6386 | + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) |
| 6387 | + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); |
| 6388 | + |
| 6389 | + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) |
| 6390 | + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); |
| 6391 | + |
| 6392 | + } |
| 6393 | +}); |
| 6394 | + |
| 6395 | +$.ui.plugin.add("resizable", "ghost", { |
| 6396 | + |
| 6397 | + start: function(event, ui) { |
| 6398 | + |
| 6399 | + var self = $(this).data("resizable"), o = self.options, cs = self.size; |
| 6400 | + |
| 6401 | + self.ghost = self.originalElement.clone(); |
| 6402 | + self.ghost |
| 6403 | + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) |
| 6404 | + .addClass('ui-resizable-ghost') |
| 6405 | + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); |
| 6406 | + |
| 6407 | + self.ghost.appendTo(self.helper); |
| 6408 | + |
| 6409 | + }, |
| 6410 | + |
| 6411 | + resize: function(event, ui){ |
| 6412 | + var self = $(this).data("resizable"), o = self.options; |
| 6413 | + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); |
| 6414 | + }, |
| 6415 | + |
| 6416 | + stop: function(event, ui){ |
| 6417 | + var self = $(this).data("resizable"), o = self.options; |
| 6418 | + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); |
| 6419 | + } |
| 6420 | + |
| 6421 | +}); |
| 6422 | + |
| 6423 | +$.ui.plugin.add("resizable", "grid", { |
| 6424 | + |
| 6425 | + resize: function(event, ui) { |
| 6426 | + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; |
| 6427 | + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; |
| 6428 | + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); |
| 6429 | + |
| 6430 | + if (/^(se|s|e)$/.test(a)) { |
| 6431 | + self.size.width = os.width + ox; |
| 6432 | + self.size.height = os.height + oy; |
| 6433 | + } |
| 6434 | + else if (/^(ne)$/.test(a)) { |
| 6435 | + self.size.width = os.width + ox; |
| 6436 | + self.size.height = os.height + oy; |
| 6437 | + self.position.top = op.top - oy; |
| 6438 | + } |
| 6439 | + else if (/^(sw)$/.test(a)) { |
| 6440 | + self.size.width = os.width + ox; |
| 6441 | + self.size.height = os.height + oy; |
| 6442 | + self.position.left = op.left - ox; |
| 6443 | + } |
| 6444 | + else { |
| 6445 | + self.size.width = os.width + ox; |
| 6446 | + self.size.height = os.height + oy; |
| 6447 | + self.position.top = op.top - oy; |
| 6448 | + self.position.left = op.left - ox; |
| 6449 | + } |
| 6450 | + } |
| 6451 | + |
| 6452 | +}); |
| 6453 | + |
| 6454 | +var num = function(v) { |
| 6455 | + return parseInt(v, 10) || 0; |
| 6456 | +}; |
| 6457 | + |
| 6458 | +var isNumber = function(value) { |
| 6459 | + return !isNaN(parseInt(value, 10)); |
| 6460 | +}; |
| 6461 | + |
| 6462 | +})(jQuery); |
| 6463 | +/* |
| 6464 | + * jQuery UI Dialog 1.7.2 |
| 6465 | + * |
| 6466 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 6467 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 6468 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 6469 | + * |
| 6470 | + * http://docs.jquery.com/UI/Dialog |
| 6471 | + * |
| 6472 | + * Depends: |
| 6473 | + * ui.core.js |
| 6474 | + * ui.draggable.js |
| 6475 | + * ui.resizable.js |
| 6476 | + */ |
| 6477 | +(function($) { |
| 6478 | + |
| 6479 | +var setDataSwitch = { |
| 6480 | + dragStart: "start.draggable", |
| 6481 | + drag: "drag.draggable", |
| 6482 | + dragStop: "stop.draggable", |
| 6483 | + maxHeight: "maxHeight.resizable", |
| 6484 | + minHeight: "minHeight.resizable", |
| 6485 | + maxWidth: "maxWidth.resizable", |
| 6486 | + minWidth: "minWidth.resizable", |
| 6487 | + resizeStart: "start.resizable", |
| 6488 | + resize: "drag.resizable", |
| 6489 | + resizeStop: "stop.resizable" |
| 6490 | + }, |
| 6491 | + |
| 6492 | + uiDialogClasses = |
| 6493 | + 'ui-dialog ' + |
| 6494 | + 'ui-widget ' + |
| 6495 | + 'ui-widget-content ' + |
| 6496 | + 'ui-corner-all '; |
| 6497 | + |
| 6498 | +$.widget("ui.dialog", { |
| 6499 | + |
| 6500 | + _init: function() { |
| 6501 | + this.originalTitle = this.element.attr('title'); |
| 6502 | + |
| 6503 | + var self = this, |
| 6504 | + options = this.options, |
| 6505 | + |
| 6506 | + title = options.title || this.originalTitle || ' ', |
| 6507 | + titleId = $.ui.dialog.getTitleId(this.element), |
| 6508 | + |
| 6509 | + uiDialog = (this.uiDialog = $('<div/>')) |
| 6510 | + .appendTo(document.body) |
| 6511 | + .hide() |
| 6512 | + .addClass(uiDialogClasses + options.dialogClass) |
| 6513 | + .css({ |
| 6514 | + position: 'absolute', |
| 6515 | + overflow: 'hidden', |
| 6516 | + zIndex: options.zIndex |
| 6517 | + }) |
| 6518 | + // setting tabIndex makes the div focusable |
| 6519 | + // setting outline to 0 prevents a border on focus in Mozilla |
| 6520 | + .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { |
| 6521 | + (options.closeOnEscape && event.keyCode |
| 6522 | + && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event)); |
| 6523 | + }) |
| 6524 | + .attr({ |
| 6525 | + role: 'dialog', |
| 6526 | + 'aria-labelledby': titleId |
| 6527 | + }) |
| 6528 | + .mousedown(function(event) { |
| 6529 | + self.moveToTop(false, event); |
| 6530 | + }), |
| 6531 | + |
| 6532 | + uiDialogContent = this.element |
| 6533 | + .show() |
| 6534 | + .removeAttr('title') |
| 6535 | + .addClass( |
| 6536 | + 'ui-dialog-content ' + |
| 6537 | + 'ui-widget-content') |
| 6538 | + .appendTo(uiDialog), |
| 6539 | + |
| 6540 | + uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>')) |
| 6541 | + .addClass( |
| 6542 | + 'ui-dialog-titlebar ' + |
| 6543 | + 'ui-widget-header ' + |
| 6544 | + 'ui-corner-all ' + |
| 6545 | + 'ui-helper-clearfix' |
| 6546 | + ) |
| 6547 | + .prependTo(uiDialog), |
| 6548 | + |
| 6549 | + uiDialogTitlebarClose = $('<a href="#"/>') |
| 6550 | + .addClass( |
| 6551 | + 'ui-dialog-titlebar-close ' + |
| 6552 | + 'ui-corner-all' |
| 6553 | + ) |
| 6554 | + .attr('role', 'button') |
| 6555 | + .hover( |
| 6556 | + function() { |
| 6557 | + uiDialogTitlebarClose.addClass('ui-state-hover'); |
| 6558 | + }, |
| 6559 | + function() { |
| 6560 | + uiDialogTitlebarClose.removeClass('ui-state-hover'); |
| 6561 | + } |
| 6562 | + ) |
| 6563 | + .focus(function() { |
| 6564 | + uiDialogTitlebarClose.addClass('ui-state-focus'); |
| 6565 | + }) |
| 6566 | + .blur(function() { |
| 6567 | + uiDialogTitlebarClose.removeClass('ui-state-focus'); |
| 6568 | + }) |
| 6569 | + .mousedown(function(ev) { |
| 6570 | + ev.stopPropagation(); |
| 6571 | + }) |
| 6572 | + .click(function(event) { |
| 6573 | + self.close(event); |
| 6574 | + return false; |
| 6575 | + }) |
| 6576 | + .appendTo(uiDialogTitlebar), |
| 6577 | + |
| 6578 | + uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) |
| 6579 | + .addClass( |
| 6580 | + 'ui-icon ' + |
| 6581 | + 'ui-icon-closethick' |
| 6582 | + ) |
| 6583 | + .text(options.closeText) |
| 6584 | + .appendTo(uiDialogTitlebarClose), |
| 6585 | + |
| 6586 | + uiDialogTitle = $('<span/>') |
| 6587 | + .addClass('ui-dialog-title') |
| 6588 | + .attr('id', titleId) |
| 6589 | + .html(title) |
| 6590 | + .prependTo(uiDialogTitlebar); |
| 6591 | + |
| 6592 | + uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); |
| 6593 | + |
| 6594 | + (options.draggable && $.fn.draggable && this._makeDraggable()); |
| 6595 | + (options.resizable && $.fn.resizable && this._makeResizable()); |
| 6596 | + |
| 6597 | + this._createButtons(options.buttons); |
| 6598 | + this._isOpen = false; |
| 6599 | + |
| 6600 | + (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe()); |
| 6601 | + (options.autoOpen && this.open()); |
| 6602 | + |
| 6603 | + }, |
| 6604 | + |
| 6605 | + destroy: function() { |
| 6606 | + (this.overlay && this.overlay.destroy()); |
| 6607 | + this.uiDialog.hide(); |
| 6608 | + this.element |
| 6609 | + .unbind('.dialog') |
| 6610 | + .removeData('dialog') |
| 6611 | + .removeClass('ui-dialog-content ui-widget-content') |
| 6612 | + .hide().appendTo('body'); |
| 6613 | + this.uiDialog.remove(); |
| 6614 | + |
| 6615 | + (this.originalTitle && this.element.attr('title', this.originalTitle)); |
| 6616 | + }, |
| 6617 | + |
| 6618 | + close: function(event) { |
| 6619 | + var self = this; |
| 6620 | + |
| 6621 | + if (false === self._trigger('beforeclose', event)) { |
| 6622 | + return; |
| 6623 | + } |
| 6624 | + |
| 6625 | + (self.overlay && self.overlay.destroy()); |
| 6626 | + self.uiDialog.unbind('keypress.ui-dialog'); |
| 6627 | + |
| 6628 | + (self.options.hide |
| 6629 | + ? self.uiDialog.hide(self.options.hide, function() { |
| 6630 | + self._trigger('close', event); |
| 6631 | + }) |
| 6632 | + : self.uiDialog.hide() && self._trigger('close', event)); |
| 6633 | + |
| 6634 | + $.ui.dialog.overlay.resize(); |
| 6635 | + |
| 6636 | + self._isOpen = false; |
| 6637 | + |
| 6638 | + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) |
| 6639 | + if (self.options.modal) { |
| 6640 | + var maxZ = 0; |
| 6641 | + $('.ui-dialog').each(function() { |
| 6642 | + if (this != self.uiDialog[0]) { |
| 6643 | + maxZ = Math.max(maxZ, $(this).css('z-index')); |
| 6644 | + } |
| 6645 | + }); |
| 6646 | + $.ui.dialog.maxZ = maxZ; |
| 6647 | + } |
| 6648 | + }, |
| 6649 | + |
| 6650 | + isOpen: function() { |
| 6651 | + return this._isOpen; |
| 6652 | + }, |
| 6653 | + |
| 6654 | + // the force parameter allows us to move modal dialogs to their correct |
| 6655 | + // position on open |
| 6656 | + moveToTop: function(force, event) { |
| 6657 | + |
| 6658 | + if ((this.options.modal && !force) |
| 6659 | + || (!this.options.stack && !this.options.modal)) { |
| 6660 | + return this._trigger('focus', event); |
| 6661 | + } |
| 6662 | + |
| 6663 | + if (this.options.zIndex > $.ui.dialog.maxZ) { |
| 6664 | + $.ui.dialog.maxZ = this.options.zIndex; |
| 6665 | + } |
| 6666 | + (this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ)); |
| 6667 | + |
| 6668 | + //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. |
| 6669 | + // http://ui.jquery.com/bugs/ticket/3193 |
| 6670 | + var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') }; |
| 6671 | + this.uiDialog.css('z-index', ++$.ui.dialog.maxZ); |
| 6672 | + this.element.attr(saveScroll); |
| 6673 | + this._trigger('focus', event); |
| 6674 | + }, |
| 6675 | + |
| 6676 | + open: function() { |
| 6677 | + if (this._isOpen) { return; } |
| 6678 | + |
| 6679 | + var options = this.options, |
| 6680 | + uiDialog = this.uiDialog; |
| 6681 | + |
| 6682 | + this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null; |
| 6683 | + (uiDialog.next().length && uiDialog.appendTo('body')); |
| 6684 | + this._size(); |
| 6685 | + this._position(options.position); |
| 6686 | + uiDialog.show(options.show); |
| 6687 | + this.moveToTop(true); |
| 6688 | + |
| 6689 | + // prevent tabbing out of modal dialogs |
| 6690 | + (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) { |
| 6691 | + if (event.keyCode != $.ui.keyCode.TAB) { |
| 6692 | + return; |
| 6693 | + } |
| 6694 | + |
| 6695 | + var tabbables = $(':tabbable', this), |
| 6696 | + first = tabbables.filter(':first')[0], |
| 6697 | + last = tabbables.filter(':last')[0]; |
| 6698 | + |
| 6699 | + if (event.target == last && !event.shiftKey) { |
| 6700 | + setTimeout(function() { |
| 6701 | + first.focus(); |
| 6702 | + }, 1); |
| 6703 | + } else if (event.target == first && event.shiftKey) { |
| 6704 | + setTimeout(function() { |
| 6705 | + last.focus(); |
| 6706 | + }, 1); |
| 6707 | + } |
| 6708 | + })); |
| 6709 | + |
| 6710 | + // set focus to the first tabbable element in the content area or the first button |
| 6711 | + // if there are no tabbable elements, set focus on the dialog itself |
| 6712 | + $([]) |
| 6713 | + .add(uiDialog.find('.ui-dialog-content :tabbable:first')) |
| 6714 | + .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')) |
| 6715 | + .add(uiDialog) |
| 6716 | + .filter(':first') |
| 6717 | + .focus(); |
| 6718 | + |
| 6719 | + this._trigger('open'); |
| 6720 | + this._isOpen = true; |
| 6721 | + }, |
| 6722 | + |
| 6723 | + _createButtons: function(buttons) { |
| 6724 | + var self = this, |
| 6725 | + hasButtons = false, |
| 6726 | + uiDialogButtonPane = $('<div></div>') |
| 6727 | + .addClass( |
| 6728 | + 'ui-dialog-buttonpane ' + |
| 6729 | + 'ui-widget-content ' + |
| 6730 | + 'ui-helper-clearfix' |
| 6731 | + ); |
| 6732 | + |
| 6733 | + // if we already have a button pane, remove it |
| 6734 | + this.uiDialog.find('.ui-dialog-buttonpane').remove(); |
| 6735 | + |
| 6736 | + (typeof buttons == 'object' && buttons !== null && |
| 6737 | + $.each(buttons, function() { return !(hasButtons = true); })); |
| 6738 | + if (hasButtons) { |
| 6739 | + $.each(buttons, function(name, fn) { |
| 6740 | + $('<button type="button"></button>') |
| 6741 | + .addClass( |
| 6742 | + 'ui-state-default ' + |
| 6743 | + 'ui-corner-all' |
| 6744 | + ) |
| 6745 | + .text(name) |
| 6746 | + .click(function() { fn.apply(self.element[0], arguments); }) |
| 6747 | + .hover( |
| 6748 | + function() { |
| 6749 | + $(this).addClass('ui-state-hover'); |
| 6750 | + }, |
| 6751 | + function() { |
| 6752 | + $(this).removeClass('ui-state-hover'); |
| 6753 | + } |
| 6754 | + ) |
| 6755 | + .focus(function() { |
| 6756 | + $(this).addClass('ui-state-focus'); |
| 6757 | + }) |
| 6758 | + .blur(function() { |
| 6759 | + $(this).removeClass('ui-state-focus'); |
| 6760 | + }) |
| 6761 | + .appendTo(uiDialogButtonPane); |
| 6762 | + }); |
| 6763 | + uiDialogButtonPane.appendTo(this.uiDialog); |
| 6764 | + } |
| 6765 | + }, |
| 6766 | + |
| 6767 | + _makeDraggable: function() { |
| 6768 | + var self = this, |
| 6769 | + options = this.options, |
| 6770 | + heightBeforeDrag; |
| 6771 | + |
| 6772 | + this.uiDialog.draggable({ |
| 6773 | + cancel: '.ui-dialog-content', |
| 6774 | + handle: '.ui-dialog-titlebar', |
| 6775 | + containment: 'document', |
| 6776 | + start: function() { |
| 6777 | + heightBeforeDrag = options.height; |
| 6778 | + $(this).height($(this).height()).addClass("ui-dialog-dragging"); |
| 6779 | + (options.dragStart && options.dragStart.apply(self.element[0], arguments)); |
| 6780 | + }, |
| 6781 | + drag: function() { |
| 6782 | + (options.drag && options.drag.apply(self.element[0], arguments)); |
| 6783 | + }, |
| 6784 | + stop: function() { |
| 6785 | + $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag); |
| 6786 | + (options.dragStop && options.dragStop.apply(self.element[0], arguments)); |
| 6787 | + $.ui.dialog.overlay.resize(); |
| 6788 | + } |
| 6789 | + }); |
| 6790 | + }, |
| 6791 | + |
| 6792 | + _makeResizable: function(handles) { |
| 6793 | + handles = (handles === undefined ? this.options.resizable : handles); |
| 6794 | + var self = this, |
| 6795 | + options = this.options, |
| 6796 | + resizeHandles = typeof handles == 'string' |
| 6797 | + ? handles |
| 6798 | + : 'n,e,s,w,se,sw,ne,nw'; |
| 6799 | + |
| 6800 | + this.uiDialog.resizable({ |
| 6801 | + cancel: '.ui-dialog-content', |
| 6802 | + alsoResize: this.element, |
| 6803 | + maxWidth: options.maxWidth, |
| 6804 | + maxHeight: options.maxHeight, |
| 6805 | + minWidth: options.minWidth, |
| 6806 | + minHeight: options.minHeight, |
| 6807 | + start: function() { |
| 6808 | + $(this).addClass("ui-dialog-resizing"); |
| 6809 | + (options.resizeStart && options.resizeStart.apply(self.element[0], arguments)); |
| 6810 | + }, |
| 6811 | + resize: function() { |
| 6812 | + (options.resize && options.resize.apply(self.element[0], arguments)); |
| 6813 | + }, |
| 6814 | + handles: resizeHandles, |
| 6815 | + stop: function() { |
| 6816 | + $(this).removeClass("ui-dialog-resizing"); |
| 6817 | + options.height = $(this).height(); |
| 6818 | + options.width = $(this).width(); |
| 6819 | + (options.resizeStop && options.resizeStop.apply(self.element[0], arguments)); |
| 6820 | + $.ui.dialog.overlay.resize(); |
| 6821 | + } |
| 6822 | + }) |
| 6823 | + .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); |
| 6824 | + }, |
| 6825 | + |
| 6826 | + _position: function(pos) { |
| 6827 | + var wnd = $(window), doc = $(document), |
| 6828 | + pTop = doc.scrollTop(), pLeft = doc.scrollLeft(), |
| 6829 | + minTop = pTop; |
| 6830 | + |
| 6831 | + if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) { |
| 6832 | + pos = [ |
| 6833 | + pos == 'right' || pos == 'left' ? pos : 'center', |
| 6834 | + pos == 'top' || pos == 'bottom' ? pos : 'middle' |
| 6835 | + ]; |
| 6836 | + } |
| 6837 | + if (pos.constructor != Array) { |
| 6838 | + pos = ['center', 'middle']; |
| 6839 | + } |
| 6840 | + if (pos[0].constructor == Number) { |
| 6841 | + pLeft += pos[0]; |
| 6842 | + } else { |
| 6843 | + switch (pos[0]) { |
| 6844 | + case 'left': |
| 6845 | + pLeft += 0; |
| 6846 | + break; |
| 6847 | + case 'right': |
| 6848 | + pLeft += wnd.width() - this.uiDialog.outerWidth(); |
| 6849 | + break; |
| 6850 | + default: |
| 6851 | + case 'center': |
| 6852 | + pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2; |
| 6853 | + } |
| 6854 | + } |
| 6855 | + if (pos[1].constructor == Number) { |
| 6856 | + pTop += pos[1]; |
| 6857 | + } else { |
| 6858 | + switch (pos[1]) { |
| 6859 | + case 'top': |
| 6860 | + pTop += 0; |
| 6861 | + break; |
| 6862 | + case 'bottom': |
| 6863 | + pTop += wnd.height() - this.uiDialog.outerHeight(); |
| 6864 | + break; |
| 6865 | + default: |
| 6866 | + case 'middle': |
| 6867 | + pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2; |
| 6868 | + } |
| 6869 | + } |
| 6870 | + |
| 6871 | + // prevent the dialog from being too high (make sure the titlebar |
| 6872 | + // is accessible) |
| 6873 | + pTop = Math.max(pTop, minTop); |
| 6874 | + this.uiDialog.css({top: pTop, left: pLeft}); |
| 6875 | + }, |
| 6876 | + |
| 6877 | + _setData: function(key, value){ |
| 6878 | + (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value)); |
| 6879 | + switch (key) { |
| 6880 | + case "buttons": |
| 6881 | + this._createButtons(value); |
| 6882 | + break; |
| 6883 | + case "closeText": |
| 6884 | + this.uiDialogTitlebarCloseText.text(value); |
| 6885 | + break; |
| 6886 | + case "dialogClass": |
| 6887 | + this.uiDialog |
| 6888 | + .removeClass(this.options.dialogClass) |
| 6889 | + .addClass(uiDialogClasses + value); |
| 6890 | + break; |
| 6891 | + case "draggable": |
| 6892 | + (value |
| 6893 | + ? this._makeDraggable() |
| 6894 | + : this.uiDialog.draggable('destroy')); |
| 6895 | + break; |
| 6896 | + case "height": |
| 6897 | + this.uiDialog.height(value); |
| 6898 | + break; |
| 6899 | + case "position": |
| 6900 | + this._position(value); |
| 6901 | + break; |
| 6902 | + case "resizable": |
| 6903 | + var uiDialog = this.uiDialog, |
| 6904 | + isResizable = this.uiDialog.is(':data(resizable)'); |
| 6905 | + |
| 6906 | + // currently resizable, becoming non-resizable |
| 6907 | + (isResizable && !value && uiDialog.resizable('destroy')); |
| 6908 | + |
| 6909 | + // currently resizable, changing handles |
| 6910 | + (isResizable && typeof value == 'string' && |
| 6911 | + uiDialog.resizable('option', 'handles', value)); |
| 6912 | + |
| 6913 | + // currently non-resizable, becoming resizable |
| 6914 | + (isResizable || this._makeResizable(value)); |
| 6915 | + break; |
| 6916 | + case "title": |
| 6917 | + $(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' '); |
| 6918 | + break; |
| 6919 | + case "width": |
| 6920 | + this.uiDialog.width(value); |
| 6921 | + break; |
| 6922 | + } |
| 6923 | + |
| 6924 | + $.widget.prototype._setData.apply(this, arguments); |
| 6925 | + }, |
| 6926 | + |
| 6927 | + _size: function() { |
| 6928 | + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content |
| 6929 | + * divs will both have width and height set, so we need to reset them |
| 6930 | + */ |
| 6931 | + var options = this.options; |
| 6932 | + |
| 6933 | + // reset content sizing |
| 6934 | + this.element.css({ |
| 6935 | + height: 0, |
| 6936 | + minHeight: 0, |
| 6937 | + width: 'auto' |
| 6938 | + }); |
| 6939 | + |
| 6940 | + // reset wrapper sizing |
| 6941 | + // determine the height of all the non-content elements |
| 6942 | + var nonContentHeight = this.uiDialog.css({ |
| 6943 | + height: 'auto', |
| 6944 | + width: options.width |
| 6945 | + }) |
| 6946 | + .height(); |
| 6947 | + |
| 6948 | + this.element |
| 6949 | + .css({ |
| 6950 | + minHeight: Math.max(options.minHeight - nonContentHeight, 0), |
| 6951 | + height: options.height == 'auto' |
| 6952 | + ? 'auto' |
| 6953 | + : Math.max(options.height - nonContentHeight, 0) |
| 6954 | + }); |
| 6955 | + } |
| 6956 | +}); |
| 6957 | + |
| 6958 | +$.extend($.ui.dialog, { |
| 6959 | + version: "1.7.2", |
| 6960 | + defaults: { |
| 6961 | + autoOpen: true, |
| 6962 | + bgiframe: false, |
| 6963 | + buttons: {}, |
| 6964 | + closeOnEscape: true, |
| 6965 | + closeText: 'close', |
| 6966 | + dialogClass: '', |
| 6967 | + draggable: true, |
| 6968 | + hide: null, |
| 6969 | + height: 'auto', |
| 6970 | + maxHeight: false, |
| 6971 | + maxWidth: false, |
| 6972 | + minHeight: 150, |
| 6973 | + minWidth: 150, |
| 6974 | + modal: false, |
| 6975 | + position: 'center', |
| 6976 | + resizable: true, |
| 6977 | + show: null, |
| 6978 | + stack: true, |
| 6979 | + title: '', |
| 6980 | + width: 300, |
| 6981 | + zIndex: 1000 |
| 6982 | + }, |
| 6983 | + |
| 6984 | + getter: 'isOpen', |
| 6985 | + |
| 6986 | + uuid: 0, |
| 6987 | + maxZ: 0, |
| 6988 | + |
| 6989 | + getTitleId: function($el) { |
| 6990 | + return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid); |
| 6991 | + }, |
| 6992 | + |
| 6993 | + overlay: function(dialog) { |
| 6994 | + this.$el = $.ui.dialog.overlay.create(dialog); |
| 6995 | + } |
| 6996 | +}); |
| 6997 | + |
| 6998 | +$.extend($.ui.dialog.overlay, { |
| 6999 | + instances: [], |
| 7000 | + maxZ: 0, |
| 7001 | + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), |
| 7002 | + function(event) { return event + '.dialog-overlay'; }).join(' '), |
| 7003 | + create: function(dialog) { |
| 7004 | + if (this.instances.length === 0) { |
| 7005 | + // prevent use of anchors and inputs |
| 7006 | + // we use a setTimeout in case the overlay is created from an |
| 7007 | + // event that we're going to be cancelling (see #2804) |
| 7008 | + setTimeout(function() { |
| 7009 | + // handle $(el).dialog().dialog('close') (see #4065) |
| 7010 | + if ($.ui.dialog.overlay.instances.length) { |
| 7011 | + $(document).bind($.ui.dialog.overlay.events, function(event) { |
| 7012 | + var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0; |
| 7013 | + return (dialogZ > $.ui.dialog.overlay.maxZ); |
| 7014 | + }); |
| 7015 | + } |
| 7016 | + }, 1); |
| 7017 | + |
| 7018 | + // allow closing by pressing the escape key |
| 7019 | + $(document).bind('keydown.dialog-overlay', function(event) { |
| 7020 | + (dialog.options.closeOnEscape && event.keyCode |
| 7021 | + && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event)); |
| 7022 | + }); |
| 7023 | + |
| 7024 | + // handle window resize |
| 7025 | + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); |
| 7026 | + } |
| 7027 | + |
| 7028 | + var $el = $('<div></div>').appendTo(document.body) |
| 7029 | + .addClass('ui-widget-overlay').css({ |
| 7030 | + width: this.width(), |
| 7031 | + height: this.height() |
| 7032 | + }); |
| 7033 | + |
| 7034 | + (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe()); |
| 7035 | + |
| 7036 | + this.instances.push($el); |
| 7037 | + return $el; |
| 7038 | + }, |
| 7039 | + |
| 7040 | + destroy: function($el) { |
| 7041 | + this.instances.splice($.inArray(this.instances, $el), 1); |
| 7042 | + |
| 7043 | + if (this.instances.length === 0) { |
| 7044 | + $([document, window]).unbind('.dialog-overlay'); |
| 7045 | + } |
| 7046 | + |
| 7047 | + $el.remove(); |
| 7048 | + |
| 7049 | + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) |
| 7050 | + var maxZ = 0; |
| 7051 | + $.each(this.instances, function() { |
| 7052 | + maxZ = Math.max(maxZ, this.css('z-index')); |
| 7053 | + }); |
| 7054 | + this.maxZ = maxZ; |
| 7055 | + }, |
| 7056 | + |
| 7057 | + height: function() { |
| 7058 | + // handle IE 6 |
| 7059 | + if ($.browser.msie && $.browser.version < 7) { |
| 7060 | + var scrollHeight = Math.max( |
| 7061 | + document.documentElement.scrollHeight, |
| 7062 | + document.body.scrollHeight |
| 7063 | + ); |
| 7064 | + var offsetHeight = Math.max( |
| 7065 | + document.documentElement.offsetHeight, |
| 7066 | + document.body.offsetHeight |
| 7067 | + ); |
| 7068 | + |
| 7069 | + if (scrollHeight < offsetHeight) { |
| 7070 | + return $(window).height() + 'px'; |
| 7071 | + } else { |
| 7072 | + return scrollHeight + 'px'; |
| 7073 | + } |
| 7074 | + // handle "good" browsers |
| 7075 | + } else { |
| 7076 | + return $(document).height() + 'px'; |
| 7077 | + } |
| 7078 | + }, |
| 7079 | + |
| 7080 | + width: function() { |
| 7081 | + // handle IE 6 |
| 7082 | + if ($.browser.msie && $.browser.version < 7) { |
| 7083 | + var scrollWidth = Math.max( |
| 7084 | + document.documentElement.scrollWidth, |
| 7085 | + document.body.scrollWidth |
| 7086 | + ); |
| 7087 | + var offsetWidth = Math.max( |
| 7088 | + document.documentElement.offsetWidth, |
| 7089 | + document.body.offsetWidth |
| 7090 | + ); |
| 7091 | + |
| 7092 | + if (scrollWidth < offsetWidth) { |
| 7093 | + return $(window).width() + 'px'; |
| 7094 | + } else { |
| 7095 | + return scrollWidth + 'px'; |
| 7096 | + } |
| 7097 | + // handle "good" browsers |
| 7098 | + } else { |
| 7099 | + return $(document).width() + 'px'; |
| 7100 | + } |
| 7101 | + }, |
| 7102 | + |
| 7103 | + resize: function() { |
| 7104 | + /* If the dialog is draggable and the user drags it past the |
| 7105 | + * right edge of the window, the document becomes wider so we |
| 7106 | + * need to stretch the overlay. If the user then drags the |
| 7107 | + * dialog back to the left, the document will become narrower, |
| 7108 | + * so we need to shrink the overlay to the appropriate size. |
| 7109 | + * This is handled by shrinking the overlay before setting it |
| 7110 | + * to the full document size. |
| 7111 | + */ |
| 7112 | + var $overlays = $([]); |
| 7113 | + $.each($.ui.dialog.overlay.instances, function() { |
| 7114 | + $overlays = $overlays.add(this); |
| 7115 | + }); |
| 7116 | + |
| 7117 | + $overlays.css({ |
| 7118 | + width: 0, |
| 7119 | + height: 0 |
| 7120 | + }).css({ |
| 7121 | + width: $.ui.dialog.overlay.width(), |
| 7122 | + height: $.ui.dialog.overlay.height() |
| 7123 | + }); |
| 7124 | + } |
| 7125 | +}); |
| 7126 | + |
| 7127 | +$.extend($.ui.dialog.overlay.prototype, { |
| 7128 | + destroy: function() { |
| 7129 | + $.ui.dialog.overlay.destroy(this.$el); |
| 7130 | + } |
| 7131 | +}); |
| 7132 | + |
| 7133 | +})(jQuery); |
| 7134 | +/* |
| 7135 | + * jQuery UI Tabs 1.7.2 |
| 7136 | + * |
| 7137 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 7138 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 7139 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 7140 | + * |
| 7141 | + * http://docs.jquery.com/UI/Tabs |
| 7142 | + * |
| 7143 | + * Depends: |
| 7144 | + * ui.core.js |
| 7145 | + */ |
| 7146 | +(function($) { |
| 7147 | + |
| 7148 | +$.widget("ui.tabs", { |
| 7149 | + |
| 7150 | + _init: function() { |
| 7151 | + if (this.options.deselectable !== undefined) { |
| 7152 | + this.options.collapsible = this.options.deselectable; |
| 7153 | + } |
| 7154 | + this._tabify(true); |
| 7155 | + }, |
| 7156 | + |
| 7157 | + _setData: function(key, value) { |
| 7158 | + if (key == 'selected') { |
| 7159 | + if (this.options.collapsible && value == this.options.selected) { |
| 7160 | + return; |
| 7161 | + } |
| 7162 | + this.select(value); |
| 7163 | + } |
| 7164 | + else { |
| 7165 | + this.options[key] = value; |
| 7166 | + if (key == 'deselectable') { |
| 7167 | + this.options.collapsible = value; |
| 7168 | + } |
| 7169 | + this._tabify(); |
| 7170 | + } |
| 7171 | + }, |
| 7172 | + |
| 7173 | + _tabId: function(a) { |
| 7174 | + return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') || |
| 7175 | + this.options.idPrefix + $.data(a); |
| 7176 | + }, |
| 7177 | + |
| 7178 | + _sanitizeSelector: function(hash) { |
| 7179 | + return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":" |
| 7180 | + }, |
| 7181 | + |
| 7182 | + _cookie: function() { |
| 7183 | + var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + $.data(this.list[0])); |
| 7184 | + return $.cookie.apply(null, [cookie].concat($.makeArray(arguments))); |
| 7185 | + }, |
| 7186 | + |
| 7187 | + _ui: function(tab, panel) { |
| 7188 | + return { |
| 7189 | + tab: tab, |
| 7190 | + panel: panel, |
| 7191 | + index: this.anchors.index(tab) |
| 7192 | + }; |
| 7193 | + }, |
| 7194 | + |
| 7195 | + _cleanup: function() { |
| 7196 | + // restore all former loading tabs labels |
| 7197 | + this.lis.filter('.ui-state-processing').removeClass('ui-state-processing') |
| 7198 | + .find('span:data(label.tabs)') |
| 7199 | + .each(function() { |
| 7200 | + var el = $(this); |
| 7201 | + el.html(el.data('label.tabs')).removeData('label.tabs'); |
| 7202 | + }); |
| 7203 | + }, |
| 7204 | + |
| 7205 | + _tabify: function(init) { |
| 7206 | + |
| 7207 | + this.list = this.element.children('ul:first'); |
| 7208 | + this.lis = $('li:has(a[href])', this.list); |
| 7209 | + this.anchors = this.lis.map(function() { return $('a', this)[0]; }); |
| 7210 | + this.panels = $([]); |
| 7211 | + |
| 7212 | + var self = this, o = this.options; |
| 7213 | + |
| 7214 | + var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash |
| 7215 | + this.anchors.each(function(i, a) { |
| 7216 | + var href = $(a).attr('href'); |
| 7217 | + |
| 7218 | + // For dynamically created HTML that contains a hash as href IE < 8 expands |
| 7219 | + // such href to the full page url with hash and then misinterprets tab as ajax. |
| 7220 | + // Same consideration applies for an added tab with a fragment identifier |
| 7221 | + // since a[href=#fragment-identifier] does unexpectedly not match. |
| 7222 | + // Thus normalize href attribute... |
| 7223 | + var hrefBase = href.split('#')[0], baseEl; |
| 7224 | + if (hrefBase && (hrefBase === location.toString().split('#')[0] || |
| 7225 | + (baseEl = $('base')[0]) && hrefBase === baseEl.href)) { |
| 7226 | + href = a.hash; |
| 7227 | + a.href = href; |
| 7228 | + } |
| 7229 | + |
| 7230 | + // inline tab |
| 7231 | + if (fragmentId.test(href)) { |
| 7232 | + self.panels = self.panels.add(self._sanitizeSelector(href)); |
| 7233 | + } |
| 7234 | + |
| 7235 | + // remote tab |
| 7236 | + else if (href != '#') { // prevent loading the page itself if href is just "#" |
| 7237 | + $.data(a, 'href.tabs', href); // required for restore on destroy |
| 7238 | + |
| 7239 | + // TODO until #3808 is fixed strip fragment identifier from url |
| 7240 | + // (IE fails to load from such url) |
| 7241 | + $.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data |
| 7242 | + |
| 7243 | + var id = self._tabId(a); |
| 7244 | + a.href = '#' + id; |
| 7245 | + var $panel = $('#' + id); |
| 7246 | + if (!$panel.length) { |
| 7247 | + $panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom') |
| 7248 | + .insertAfter(self.panels[i - 1] || self.list); |
| 7249 | + $panel.data('destroy.tabs', true); |
| 7250 | + } |
| 7251 | + self.panels = self.panels.add($panel); |
| 7252 | + } |
| 7253 | + |
| 7254 | + // invalid tab href |
| 7255 | + else { |
| 7256 | + o.disabled.push(i); |
| 7257 | + } |
| 7258 | + }); |
| 7259 | + |
| 7260 | + // initialization from scratch |
| 7261 | + if (init) { |
| 7262 | + |
| 7263 | + // attach necessary classes for styling |
| 7264 | + this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all'); |
| 7265 | + this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); |
| 7266 | + this.lis.addClass('ui-state-default ui-corner-top'); |
| 7267 | + this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom'); |
| 7268 | + |
| 7269 | + // Selected tab |
| 7270 | + // use "selected" option or try to retrieve: |
| 7271 | + // 1. from fragment identifier in url |
| 7272 | + // 2. from cookie |
| 7273 | + // 3. from selected class attribute on <li> |
| 7274 | + if (o.selected === undefined) { |
| 7275 | + if (location.hash) { |
| 7276 | + this.anchors.each(function(i, a) { |
| 7277 | + if (a.hash == location.hash) { |
| 7278 | + o.selected = i; |
| 7279 | + return false; // break |
| 7280 | + } |
| 7281 | + }); |
| 7282 | + } |
| 7283 | + if (typeof o.selected != 'number' && o.cookie) { |
| 7284 | + o.selected = parseInt(self._cookie(), 10); |
| 7285 | + } |
| 7286 | + if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) { |
| 7287 | + o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected')); |
| 7288 | + } |
| 7289 | + o.selected = o.selected || 0; |
| 7290 | + } |
| 7291 | + else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release |
| 7292 | + o.selected = -1; |
| 7293 | + } |
| 7294 | + |
| 7295 | + // sanity check - default to first tab... |
| 7296 | + o.selected = ((o.selected >= 0 && this.anchors[o.selected]) || o.selected < 0) ? o.selected : 0; |
| 7297 | + |
| 7298 | + // Take disabling tabs via class attribute from HTML |
| 7299 | + // into account and update option properly. |
| 7300 | + // A selected tab cannot become disabled. |
| 7301 | + o.disabled = $.unique(o.disabled.concat( |
| 7302 | + $.map(this.lis.filter('.ui-state-disabled'), |
| 7303 | + function(n, i) { return self.lis.index(n); } ) |
| 7304 | + )).sort(); |
| 7305 | + |
| 7306 | + if ($.inArray(o.selected, o.disabled) != -1) { |
| 7307 | + o.disabled.splice($.inArray(o.selected, o.disabled), 1); |
| 7308 | + } |
| 7309 | + |
| 7310 | + // highlight selected tab |
| 7311 | + this.panels.addClass('ui-tabs-hide'); |
| 7312 | + this.lis.removeClass('ui-tabs-selected ui-state-active'); |
| 7313 | + if (o.selected >= 0 && this.anchors.length) { // check for length avoids error when initializing empty list |
| 7314 | + this.panels.eq(o.selected).removeClass('ui-tabs-hide'); |
| 7315 | + this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active'); |
| 7316 | + |
| 7317 | + // seems to be expected behavior that the show callback is fired |
| 7318 | + self.element.queue("tabs", function() { |
| 7319 | + self._trigger('show', null, self._ui(self.anchors[o.selected], self.panels[o.selected])); |
| 7320 | + }); |
| 7321 | + |
| 7322 | + this.load(o.selected); |
| 7323 | + } |
| 7324 | + |
| 7325 | + // clean up to avoid memory leaks in certain versions of IE 6 |
| 7326 | + $(window).bind('unload', function() { |
| 7327 | + self.lis.add(self.anchors).unbind('.tabs'); |
| 7328 | + self.lis = self.anchors = self.panels = null; |
| 7329 | + }); |
| 7330 | + |
| 7331 | + } |
| 7332 | + // update selected after add/remove |
| 7333 | + else { |
| 7334 | + o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected')); |
| 7335 | + } |
| 7336 | + |
| 7337 | + // update collapsible |
| 7338 | + this.element[o.collapsible ? 'addClass' : 'removeClass']('ui-tabs-collapsible'); |
| 7339 | + |
| 7340 | + // set or update cookie after init and add/remove respectively |
| 7341 | + if (o.cookie) { |
| 7342 | + this._cookie(o.selected, o.cookie); |
| 7343 | + } |
| 7344 | + |
| 7345 | + // disable tabs |
| 7346 | + for (var i = 0, li; (li = this.lis[i]); i++) { |
| 7347 | + $(li)[$.inArray(i, o.disabled) != -1 && |
| 7348 | + !$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled'); |
| 7349 | + } |
| 7350 | + |
| 7351 | + // reset cache if switching from cached to not cached |
| 7352 | + if (o.cache === false) { |
| 7353 | + this.anchors.removeData('cache.tabs'); |
| 7354 | + } |
| 7355 | + |
| 7356 | + // remove all handlers before, tabify may run on existing tabs after add or option change |
| 7357 | + this.lis.add(this.anchors).unbind('.tabs'); |
| 7358 | + |
| 7359 | + if (o.event != 'mouseover') { |
| 7360 | + var addState = function(state, el) { |
| 7361 | + if (el.is(':not(.ui-state-disabled)')) { |
| 7362 | + el.addClass('ui-state-' + state); |
| 7363 | + } |
| 7364 | + }; |
| 7365 | + var removeState = function(state, el) { |
| 7366 | + el.removeClass('ui-state-' + state); |
| 7367 | + }; |
| 7368 | + this.lis.bind('mouseover.tabs', function() { |
| 7369 | + addState('hover', $(this)); |
| 7370 | + }); |
| 7371 | + this.lis.bind('mouseout.tabs', function() { |
| 7372 | + removeState('hover', $(this)); |
| 7373 | + }); |
| 7374 | + this.anchors.bind('focus.tabs', function() { |
| 7375 | + addState('focus', $(this).closest('li')); |
| 7376 | + }); |
| 7377 | + this.anchors.bind('blur.tabs', function() { |
| 7378 | + removeState('focus', $(this).closest('li')); |
| 7379 | + }); |
| 7380 | + } |
| 7381 | + |
| 7382 | + // set up animations |
| 7383 | + var hideFx, showFx; |
| 7384 | + if (o.fx) { |
| 7385 | + if ($.isArray(o.fx)) { |
| 7386 | + hideFx = o.fx[0]; |
| 7387 | + showFx = o.fx[1]; |
| 7388 | + } |
| 7389 | + else { |
| 7390 | + hideFx = showFx = o.fx; |
| 7391 | + } |
| 7392 | + } |
| 7393 | + |
| 7394 | + // Reset certain styles left over from animation |
| 7395 | + // and prevent IE's ClearType bug... |
| 7396 | + function resetStyle($el, fx) { |
| 7397 | + $el.css({ display: '' }); |
| 7398 | + if ($.browser.msie && fx.opacity) { |
| 7399 | + $el[0].style.removeAttribute('filter'); |
| 7400 | + } |
| 7401 | + } |
| 7402 | + |
| 7403 | + // Show a tab... |
| 7404 | + var showTab = showFx ? |
| 7405 | + function(clicked, $show) { |
| 7406 | + $(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active'); |
| 7407 | + $show.hide().removeClass('ui-tabs-hide') // avoid flicker that way |
| 7408 | + .animate(showFx, showFx.duration || 'normal', function() { |
| 7409 | + resetStyle($show, showFx); |
| 7410 | + self._trigger('show', null, self._ui(clicked, $show[0])); |
| 7411 | + }); |
| 7412 | + } : |
| 7413 | + function(clicked, $show) { |
| 7414 | + $(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active'); |
| 7415 | + $show.removeClass('ui-tabs-hide'); |
| 7416 | + self._trigger('show', null, self._ui(clicked, $show[0])); |
| 7417 | + }; |
| 7418 | + |
| 7419 | + // Hide a tab, $show is optional... |
| 7420 | + var hideTab = hideFx ? |
| 7421 | + function(clicked, $hide) { |
| 7422 | + $hide.animate(hideFx, hideFx.duration || 'normal', function() { |
| 7423 | + self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default'); |
| 7424 | + $hide.addClass('ui-tabs-hide'); |
| 7425 | + resetStyle($hide, hideFx); |
| 7426 | + self.element.dequeue("tabs"); |
| 7427 | + }); |
| 7428 | + } : |
| 7429 | + function(clicked, $hide, $show) { |
| 7430 | + self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default'); |
| 7431 | + $hide.addClass('ui-tabs-hide'); |
| 7432 | + self.element.dequeue("tabs"); |
| 7433 | + }; |
| 7434 | + |
| 7435 | + // attach tab event handler, unbind to avoid duplicates from former tabifying... |
| 7436 | + this.anchors.bind(o.event + '.tabs', function() { |
| 7437 | + var el = this, $li = $(this).closest('li'), $hide = self.panels.filter(':not(.ui-tabs-hide)'), |
| 7438 | + $show = $(self._sanitizeSelector(this.hash)); |
| 7439 | + |
| 7440 | + // If tab is already selected and not collapsible or tab disabled or |
| 7441 | + // or is already loading or click callback returns false stop here. |
| 7442 | + // Check if click handler returns false last so that it is not executed |
| 7443 | + // for a disabled or loading tab! |
| 7444 | + if (($li.hasClass('ui-tabs-selected') && !o.collapsible) || |
| 7445 | + $li.hasClass('ui-state-disabled') || |
| 7446 | + $li.hasClass('ui-state-processing') || |
| 7447 | + self._trigger('select', null, self._ui(this, $show[0])) === false) { |
| 7448 | + this.blur(); |
| 7449 | + return false; |
| 7450 | + } |
| 7451 | + |
| 7452 | + o.selected = self.anchors.index(this); |
| 7453 | + |
| 7454 | + self.abort(); |
| 7455 | + |
| 7456 | + // if tab may be closed |
| 7457 | + if (o.collapsible) { |
| 7458 | + if ($li.hasClass('ui-tabs-selected')) { |
| 7459 | + o.selected = -1; |
| 7460 | + |
| 7461 | + if (o.cookie) { |
| 7462 | + self._cookie(o.selected, o.cookie); |
| 7463 | + } |
| 7464 | + |
| 7465 | + self.element.queue("tabs", function() { |
| 7466 | + hideTab(el, $hide); |
| 7467 | + }).dequeue("tabs"); |
| 7468 | + |
| 7469 | + this.blur(); |
| 7470 | + return false; |
| 7471 | + } |
| 7472 | + else if (!$hide.length) { |
| 7473 | + if (o.cookie) { |
| 7474 | + self._cookie(o.selected, o.cookie); |
| 7475 | + } |
| 7476 | + |
| 7477 | + self.element.queue("tabs", function() { |
| 7478 | + showTab(el, $show); |
| 7479 | + }); |
| 7480 | + |
| 7481 | + self.load(self.anchors.index(this)); // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171 |
| 7482 | + |
| 7483 | + this.blur(); |
| 7484 | + return false; |
| 7485 | + } |
| 7486 | + } |
| 7487 | + |
| 7488 | + if (o.cookie) { |
| 7489 | + self._cookie(o.selected, o.cookie); |
| 7490 | + } |
| 7491 | + |
| 7492 | + // show new tab |
| 7493 | + if ($show.length) { |
| 7494 | + if ($hide.length) { |
| 7495 | + self.element.queue("tabs", function() { |
| 7496 | + hideTab(el, $hide); |
| 7497 | + }); |
| 7498 | + } |
| 7499 | + self.element.queue("tabs", function() { |
| 7500 | + showTab(el, $show); |
| 7501 | + }); |
| 7502 | + |
| 7503 | + self.load(self.anchors.index(this)); |
| 7504 | + } |
| 7505 | + else { |
| 7506 | + throw 'jQuery UI Tabs: Mismatching fragment identifier.'; |
| 7507 | + } |
| 7508 | + |
| 7509 | + // Prevent IE from keeping other link focussed when using the back button |
| 7510 | + // and remove dotted border from clicked link. This is controlled via CSS |
| 7511 | + // in modern browsers; blur() removes focus from address bar in Firefox |
| 7512 | + // which can become a usability and annoying problem with tabs('rotate'). |
| 7513 | + if ($.browser.msie) { |
| 7514 | + this.blur(); |
| 7515 | + } |
| 7516 | + |
| 7517 | + }); |
| 7518 | + |
| 7519 | + // disable click in any case |
| 7520 | + this.anchors.bind('click.tabs', function(){return false;}); |
| 7521 | + |
| 7522 | + }, |
| 7523 | + |
| 7524 | + destroy: function() { |
| 7525 | + var o = this.options; |
| 7526 | + |
| 7527 | + this.abort(); |
| 7528 | + |
| 7529 | + this.element.unbind('.tabs') |
| 7530 | + .removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible') |
| 7531 | + .removeData('tabs'); |
| 7532 | + |
| 7533 | + this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); |
| 7534 | + |
| 7535 | + this.anchors.each(function() { |
| 7536 | + var href = $.data(this, 'href.tabs'); |
| 7537 | + if (href) { |
| 7538 | + this.href = href; |
| 7539 | + } |
| 7540 | + var $this = $(this).unbind('.tabs'); |
| 7541 | + $.each(['href', 'load', 'cache'], function(i, prefix) { |
| 7542 | + $this.removeData(prefix + '.tabs'); |
| 7543 | + }); |
| 7544 | + }); |
| 7545 | + |
| 7546 | + this.lis.unbind('.tabs').add(this.panels).each(function() { |
| 7547 | + if ($.data(this, 'destroy.tabs')) { |
| 7548 | + $(this).remove(); |
| 7549 | + } |
| 7550 | + else { |
| 7551 | + $(this).removeClass([ |
| 7552 | + 'ui-state-default', |
| 7553 | + 'ui-corner-top', |
| 7554 | + 'ui-tabs-selected', |
| 7555 | + 'ui-state-active', |
| 7556 | + 'ui-state-hover', |
| 7557 | + 'ui-state-focus', |
| 7558 | + 'ui-state-disabled', |
| 7559 | + 'ui-tabs-panel', |
| 7560 | + 'ui-widget-content', |
| 7561 | + 'ui-corner-bottom', |
| 7562 | + 'ui-tabs-hide' |
| 7563 | + ].join(' ')); |
| 7564 | + } |
| 7565 | + }); |
| 7566 | + |
| 7567 | + if (o.cookie) { |
| 7568 | + this._cookie(null, o.cookie); |
| 7569 | + } |
| 7570 | + }, |
| 7571 | + |
| 7572 | + add: function(url, label, index) { |
| 7573 | + if (index === undefined) { |
| 7574 | + index = this.anchors.length; // append by default |
| 7575 | + } |
| 7576 | + |
| 7577 | + var self = this, o = this.options, |
| 7578 | + $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)), |
| 7579 | + id = !url.indexOf('#') ? url.replace('#', '') : this._tabId($('a', $li)[0]); |
| 7580 | + |
| 7581 | + $li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true); |
| 7582 | + |
| 7583 | + // try to find an existing element before creating a new one |
| 7584 | + var $panel = $('#' + id); |
| 7585 | + if (!$panel.length) { |
| 7586 | + $panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true); |
| 7587 | + } |
| 7588 | + $panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide'); |
| 7589 | + |
| 7590 | + if (index >= this.lis.length) { |
| 7591 | + $li.appendTo(this.list); |
| 7592 | + $panel.appendTo(this.list[0].parentNode); |
| 7593 | + } |
| 7594 | + else { |
| 7595 | + $li.insertBefore(this.lis[index]); |
| 7596 | + $panel.insertBefore(this.panels[index]); |
| 7597 | + } |
| 7598 | + |
| 7599 | + o.disabled = $.map(o.disabled, |
| 7600 | + function(n, i) { return n >= index ? ++n : n; }); |
| 7601 | + |
| 7602 | + this._tabify(); |
| 7603 | + |
| 7604 | + if (this.anchors.length == 1) { // after tabify |
| 7605 | + $li.addClass('ui-tabs-selected ui-state-active'); |
| 7606 | + $panel.removeClass('ui-tabs-hide'); |
| 7607 | + this.element.queue("tabs", function() { |
| 7608 | + self._trigger('show', null, self._ui(self.anchors[0], self.panels[0])); |
| 7609 | + }); |
| 7610 | + |
| 7611 | + this.load(0); |
| 7612 | + } |
| 7613 | + |
| 7614 | + // callback |
| 7615 | + this._trigger('add', null, this._ui(this.anchors[index], this.panels[index])); |
| 7616 | + }, |
| 7617 | + |
| 7618 | + remove: function(index) { |
| 7619 | + var o = this.options, $li = this.lis.eq(index).remove(), |
| 7620 | + $panel = this.panels.eq(index).remove(); |
| 7621 | + |
| 7622 | + // If selected tab was removed focus tab to the right or |
| 7623 | + // in case the last tab was removed the tab to the left. |
| 7624 | + if ($li.hasClass('ui-tabs-selected') && this.anchors.length > 1) { |
| 7625 | + this.select(index + (index + 1 < this.anchors.length ? 1 : -1)); |
| 7626 | + } |
| 7627 | + |
| 7628 | + o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }), |
| 7629 | + function(n, i) { return n >= index ? --n : n; }); |
| 7630 | + |
| 7631 | + this._tabify(); |
| 7632 | + |
| 7633 | + // callback |
| 7634 | + this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0])); |
| 7635 | + }, |
| 7636 | + |
| 7637 | + enable: function(index) { |
| 7638 | + var o = this.options; |
| 7639 | + if ($.inArray(index, o.disabled) == -1) { |
| 7640 | + return; |
| 7641 | + } |
| 7642 | + |
| 7643 | + this.lis.eq(index).removeClass('ui-state-disabled'); |
| 7644 | + o.disabled = $.grep(o.disabled, function(n, i) { return n != index; }); |
| 7645 | + |
| 7646 | + // callback |
| 7647 | + this._trigger('enable', null, this._ui(this.anchors[index], this.panels[index])); |
| 7648 | + }, |
| 7649 | + |
| 7650 | + disable: function(index) { |
| 7651 | + var self = this, o = this.options; |
| 7652 | + if (index != o.selected) { // cannot disable already selected tab |
| 7653 | + this.lis.eq(index).addClass('ui-state-disabled'); |
| 7654 | + |
| 7655 | + o.disabled.push(index); |
| 7656 | + o.disabled.sort(); |
| 7657 | + |
| 7658 | + // callback |
| 7659 | + this._trigger('disable', null, this._ui(this.anchors[index], this.panels[index])); |
| 7660 | + } |
| 7661 | + }, |
| 7662 | + |
| 7663 | + select: function(index) { |
| 7664 | + if (typeof index == 'string') { |
| 7665 | + index = this.anchors.index(this.anchors.filter('[href$=' + index + ']')); |
| 7666 | + } |
| 7667 | + else if (index === null) { // usage of null is deprecated, TODO remove in next release |
| 7668 | + index = -1; |
| 7669 | + } |
| 7670 | + if (index == -1 && this.options.collapsible) { |
| 7671 | + index = this.options.selected; |
| 7672 | + } |
| 7673 | + |
| 7674 | + this.anchors.eq(index).trigger(this.options.event + '.tabs'); |
| 7675 | + }, |
| 7676 | + |
| 7677 | + load: function(index) { |
| 7678 | + var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs'); |
| 7679 | + |
| 7680 | + this.abort(); |
| 7681 | + |
| 7682 | + // not remote or from cache |
| 7683 | + if (!url || this.element.queue("tabs").length !== 0 && $.data(a, 'cache.tabs')) { |
| 7684 | + this.element.dequeue("tabs"); |
| 7685 | + return; |
| 7686 | + } |
| 7687 | + |
| 7688 | + // load remote from here on |
| 7689 | + this.lis.eq(index).addClass('ui-state-processing'); |
| 7690 | + |
| 7691 | + if (o.spinner) { |
| 7692 | + var span = $('span', a); |
| 7693 | + span.data('label.tabs', span.html()).html(o.spinner); |
| 7694 | + } |
| 7695 | + |
| 7696 | + this.xhr = $.ajax($.extend({}, o.ajaxOptions, { |
| 7697 | + url: url, |
| 7698 | + success: function(r, s) { |
| 7699 | + $(self._sanitizeSelector(a.hash)).html(r); |
| 7700 | + |
| 7701 | + // take care of tab labels |
| 7702 | + self._cleanup(); |
| 7703 | + |
| 7704 | + if (o.cache) { |
| 7705 | + $.data(a, 'cache.tabs', true); // if loaded once do not load them again |
| 7706 | + } |
| 7707 | + |
| 7708 | + // callbacks |
| 7709 | + self._trigger('load', null, self._ui(self.anchors[index], self.panels[index])); |
| 7710 | + try { |
| 7711 | + o.ajaxOptions.success(r, s); |
| 7712 | + } |
| 7713 | + catch (e) {} |
| 7714 | + |
| 7715 | + // last, so that load event is fired before show... |
| 7716 | + self.element.dequeue("tabs"); |
| 7717 | + } |
| 7718 | + })); |
| 7719 | + }, |
| 7720 | + |
| 7721 | + abort: function() { |
| 7722 | + // stop possibly running animations |
| 7723 | + this.element.queue([]); |
| 7724 | + this.panels.stop(false, true); |
| 7725 | + |
| 7726 | + // terminate pending requests from other tabs |
| 7727 | + if (this.xhr) { |
| 7728 | + this.xhr.abort(); |
| 7729 | + delete this.xhr; |
| 7730 | + } |
| 7731 | + |
| 7732 | + // take care of tab labels |
| 7733 | + this._cleanup(); |
| 7734 | + |
| 7735 | + }, |
| 7736 | + |
| 7737 | + url: function(index, url) { |
| 7738 | + this.anchors.eq(index).removeData('cache.tabs').data('load.tabs', url); |
| 7739 | + }, |
| 7740 | + |
| 7741 | + length: function() { |
| 7742 | + return this.anchors.length; |
| 7743 | + } |
| 7744 | + |
| 7745 | +}); |
| 7746 | + |
| 7747 | +$.extend($.ui.tabs, { |
| 7748 | + version: '1.7.2', |
| 7749 | + getter: 'length', |
| 7750 | + defaults: { |
| 7751 | + ajaxOptions: null, |
| 7752 | + cache: false, |
| 7753 | + cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } |
| 7754 | + collapsible: false, |
| 7755 | + disabled: [], |
| 7756 | + event: 'click', |
| 7757 | + fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } |
| 7758 | + idPrefix: 'ui-tabs-', |
| 7759 | + panelTemplate: '<div></div>', |
| 7760 | + spinner: '<em>Loading…</em>', |
| 7761 | + tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>' |
| 7762 | + } |
| 7763 | +}); |
| 7764 | + |
| 7765 | +/* |
| 7766 | + * Tabs Extensions |
| 7767 | + */ |
| 7768 | + |
| 7769 | +/* |
| 7770 | + * Rotate |
| 7771 | + */ |
| 7772 | +$.extend($.ui.tabs.prototype, { |
| 7773 | + rotation: null, |
| 7774 | + rotate: function(ms, continuing) { |
| 7775 | + |
| 7776 | + var self = this, o = this.options; |
| 7777 | + |
| 7778 | + var rotate = self._rotate || (self._rotate = function(e) { |
| 7779 | + clearTimeout(self.rotation); |
| 7780 | + self.rotation = setTimeout(function() { |
| 7781 | + var t = o.selected; |
| 7782 | + self.select( ++t < self.anchors.length ? t : 0 ); |
| 7783 | + }, ms); |
| 7784 | + |
| 7785 | + if (e) { |
| 7786 | + e.stopPropagation(); |
| 7787 | + } |
| 7788 | + }); |
| 7789 | + |
| 7790 | + var stop = self._unrotate || (self._unrotate = !continuing ? |
| 7791 | + function(e) { |
| 7792 | + if (e.clientX) { // in case of a true click |
| 7793 | + self.rotate(null); |
| 7794 | + } |
| 7795 | + } : |
| 7796 | + function(e) { |
| 7797 | + t = o.selected; |
| 7798 | + rotate(); |
| 7799 | + }); |
| 7800 | + |
| 7801 | + // start rotation |
| 7802 | + if (ms) { |
| 7803 | + this.element.bind('tabsshow', rotate); |
| 7804 | + this.anchors.bind(o.event + '.tabs', stop); |
| 7805 | + rotate(); |
| 7806 | + } |
| 7807 | + // stop rotation |
| 7808 | + else { |
| 7809 | + clearTimeout(self.rotation); |
| 7810 | + this.element.unbind('tabsshow', rotate); |
| 7811 | + this.anchors.unbind(o.event + '.tabs', stop); |
| 7812 | + delete this._rotate; |
| 7813 | + delete this._unrotate; |
| 7814 | + } |
| 7815 | + } |
| 7816 | +}); |
| 7817 | + |
| 7818 | +})(jQuery); |
| 7819 | +/* |
| 7820 | + * jQuery UI Datepicker 1.7.2 |
| 7821 | + * |
| 7822 | + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 7823 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 7824 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 7825 | + * |
| 7826 | + * http://docs.jquery.com/UI/Datepicker |
| 7827 | + * |
| 7828 | + * Depends: |
| 7829 | + * ui.core.js |
| 7830 | + */ |
| 7831 | + |
| 7832 | +(function($) { // hide the namespace |
| 7833 | + |
| 7834 | +$.extend($.ui, { datepicker: { version: "1.7.2" } }); |
| 7835 | + |
| 7836 | +var PROP_NAME = 'datepicker'; |
| 7837 | + |
| 7838 | +/* Date picker manager. |
| 7839 | + Use the singleton instance of this class, $.datepicker, to interact with the date picker. |
| 7840 | + Settings for (groups of) date pickers are maintained in an instance object, |
| 7841 | + allowing multiple different settings on the same page. */ |
| 7842 | + |
| 7843 | +function Datepicker() { |
| 7844 | + this.debug = false; // Change this to true to start debugging |
| 7845 | + this._curInst = null; // The current instance in use |
| 7846 | + this._keyEvent = false; // If the last event was a key event |
| 7847 | + this._disabledInputs = []; // List of date picker inputs that have been disabled |
| 7848 | + this._datepickerShowing = false; // True if the popup picker is showing , false if not |
| 7849 | + this._inDialog = false; // True if showing within a "dialog", false if not |
| 7850 | + this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division |
| 7851 | + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class |
| 7852 | + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class |
| 7853 | + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class |
| 7854 | + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class |
| 7855 | + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class |
| 7856 | + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class |
| 7857 | + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class |
| 7858 | + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class |
| 7859 | + this.regional = []; // Available regional settings, indexed by language code |
| 7860 | + this.regional[''] = { // Default regional settings |
| 7861 | + closeText: 'Done', // Display text for close link |
| 7862 | + prevText: 'Prev', // Display text for previous month link |
| 7863 | + nextText: 'Next', // Display text for next month link |
| 7864 | + currentText: 'Today', // Display text for current month link |
| 7865 | + monthNames: ['January','February','March','April','May','June', |
| 7866 | + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting |
| 7867 | + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting |
| 7868 | + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting |
| 7869 | + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting |
| 7870 | + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday |
| 7871 | + dateFormat: 'mm/dd/yy', // See format options on parseDate |
| 7872 | + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... |
| 7873 | + isRTL: false // True if right-to-left language, false if left-to-right |
| 7874 | + }; |
| 7875 | + this._defaults = { // Global defaults for all the date picker instances |
| 7876 | + showOn: 'focus', // 'focus' for popup on focus, |
| 7877 | + // 'button' for trigger button, or 'both' for either |
| 7878 | + showAnim: 'show', // Name of jQuery animation for popup |
| 7879 | + showOptions: {}, // Options for enhanced animations |
| 7880 | + defaultDate: null, // Used when field is blank: actual date, |
| 7881 | + // +/-number for offset from today, null for today |
| 7882 | + appendText: '', // Display text following the input box, e.g. showing the format |
| 7883 | + buttonText: '...', // Text for trigger button |
| 7884 | + buttonImage: '', // URL for trigger button image |
| 7885 | + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button |
| 7886 | + hideIfNoPrevNext: false, // True to hide next/previous month links |
| 7887 | + // if not applicable, false to just disable them |
| 7888 | + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links |
| 7889 | + gotoCurrent: false, // True if today link goes back to current selection instead |
| 7890 | + changeMonth: false, // True if month can be selected directly, false if only prev/next |
| 7891 | + changeYear: false, // True if year can be selected directly, false if only prev/next |
| 7892 | + showMonthAfterYear: false, // True if the year select precedes month, false for month then year |
| 7893 | + yearRange: '-10:+10', // Range of years to display in drop-down, |
| 7894 | + // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) |
| 7895 | + showOtherMonths: false, // True to show dates in other months, false to leave blank |
| 7896 | + calculateWeek: this.iso8601Week, // How to calculate the week of the year, |
| 7897 | + // takes a Date and returns the number of the week for it |
| 7898 | + shortYearCutoff: '+10', // Short year values < this are in the current century, |
| 7899 | + // > this are in the previous century, |
| 7900 | + // string value starting with '+' for current year + value |
| 7901 | + minDate: null, // The earliest selectable date, or null for no limit |
| 7902 | + maxDate: null, // The latest selectable date, or null for no limit |
| 7903 | + duration: 'normal', // Duration of display/closure |
| 7904 | + beforeShowDay: null, // Function that takes a date and returns an array with |
| 7905 | + // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', |
| 7906 | + // [2] = cell title (optional), e.g. $.datepicker.noWeekends |
| 7907 | + beforeShow: null, // Function that takes an input field and |
| 7908 | + // returns a set of custom settings for the date picker |
| 7909 | + onSelect: null, // Define a callback function when a date is selected |
| 7910 | + onChangeMonthYear: null, // Define a callback function when the month or year is changed |
| 7911 | + onClose: null, // Define a callback function when the datepicker is closed |
| 7912 | + numberOfMonths: 1, // Number of months to show at a time |
| 7913 | + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) |
| 7914 | + stepMonths: 1, // Number of months to step back/forward |
| 7915 | + stepBigMonths: 12, // Number of months to step back/forward for the big links |
| 7916 | + altField: '', // Selector for an alternate field to store selected dates into |
| 7917 | + altFormat: '', // The date format to use for the alternate field |
| 7918 | + constrainInput: true, // The input is constrained by the current date format |
| 7919 | + showButtonPanel: false // True to show button panel, false to not show it |
| 7920 | + }; |
| 7921 | + $.extend(this._defaults, this.regional['']); |
| 7922 | + 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>'); |
| 7923 | +} |
| 7924 | + |
| 7925 | +$.extend(Datepicker.prototype, { |
| 7926 | + /* Class name added to elements to indicate already configured with a date picker. */ |
| 7927 | + markerClassName: 'hasDatepicker', |
| 7928 | + |
| 7929 | + /* Debug logging (if enabled). */ |
| 7930 | + log: function () { |
| 7931 | + if (this.debug) |
| 7932 | + console.log.apply('', arguments); |
| 7933 | + }, |
| 7934 | + |
| 7935 | + /* Override the default settings for all instances of the date picker. |
| 7936 | + @param settings object - the new settings to use as defaults (anonymous object) |
| 7937 | + @return the manager object */ |
| 7938 | + setDefaults: function(settings) { |
| 7939 | + extendRemove(this._defaults, settings || {}); |
| 7940 | + return this; |
| 7941 | + }, |
| 7942 | + |
| 7943 | + /* Attach the date picker to a jQuery selection. |
| 7944 | + @param target element - the target input field or division or span |
| 7945 | + @param settings object - the new settings to use for this date picker instance (anonymous) */ |
| 7946 | + _attachDatepicker: function(target, settings) { |
| 7947 | + // check for settings on the control itself - in namespace 'date:' |
| 7948 | + var inlineSettings = null; |
| 7949 | + for (var attrName in this._defaults) { |
| 7950 | + var attrValue = target.getAttribute('date:' + attrName); |
| 7951 | + if (attrValue) { |
| 7952 | + inlineSettings = inlineSettings || {}; |
| 7953 | + try { |
| 7954 | + inlineSettings[attrName] = eval(attrValue); |
| 7955 | + } catch (err) { |
| 7956 | + inlineSettings[attrName] = attrValue; |
| 7957 | + } |
| 7958 | + } |
| 7959 | + } |
| 7960 | + var nodeName = target.nodeName.toLowerCase(); |
| 7961 | + var inline = (nodeName == 'div' || nodeName == 'span'); |
| 7962 | + if (!target.id) |
| 7963 | + target.id = 'dp' + (++this.uuid); |
| 7964 | + var inst = this._newInst($(target), inline); |
| 7965 | + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); |
| 7966 | + if (nodeName == 'input') { |
| 7967 | + this._connectDatepicker(target, inst); |
| 7968 | + } else if (inline) { |
| 7969 | + this._inlineDatepicker(target, inst); |
| 7970 | + } |
| 7971 | + }, |
| 7972 | + |
| 7973 | + /* Create a new instance object. */ |
| 7974 | + _newInst: function(target, inline) { |
| 7975 | + var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars |
| 7976 | + return {id: id, input: target, // associated target |
| 7977 | + selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection |
| 7978 | + drawMonth: 0, drawYear: 0, // month being drawn |
| 7979 | + inline: inline, // is datepicker inline or not |
| 7980 | + dpDiv: (!inline ? this.dpDiv : // presentation div |
| 7981 | + $('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}; |
| 7982 | + }, |
| 7983 | + |
| 7984 | + /* Attach the date picker to an input field. */ |
| 7985 | + _connectDatepicker: function(target, inst) { |
| 7986 | + var input = $(target); |
| 7987 | + inst.append = $([]); |
| 7988 | + inst.trigger = $([]); |
| 7989 | + if (input.hasClass(this.markerClassName)) |
| 7990 | + return; |
| 7991 | + var appendText = this._get(inst, 'appendText'); |
| 7992 | + var isRTL = this._get(inst, 'isRTL'); |
| 7993 | + if (appendText) { |
| 7994 | + inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>'); |
| 7995 | + input[isRTL ? 'before' : 'after'](inst.append); |
| 7996 | + } |
| 7997 | + var showOn = this._get(inst, 'showOn'); |
| 7998 | + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field |
| 7999 | + input.focus(this._showDatepicker); |
| 8000 | + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked |
| 8001 | + var buttonText = this._get(inst, 'buttonText'); |
| 8002 | + var buttonImage = this._get(inst, 'buttonImage'); |
| 8003 | + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? |
| 8004 | + $('<img/>').addClass(this._triggerClass). |
| 8005 | + attr({ src: buttonImage, alt: buttonText, title: buttonText }) : |
| 8006 | + $('<button type="button"></button>').addClass(this._triggerClass). |
| 8007 | + html(buttonImage == '' ? buttonText : $('<img/>').attr( |
| 8008 | + { src:buttonImage, alt:buttonText, title:buttonText }))); |
| 8009 | + input[isRTL ? 'before' : 'after'](inst.trigger); |
| 8010 | + inst.trigger.click(function() { |
| 8011 | + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) |
| 8012 | + $.datepicker._hideDatepicker(); |
| 8013 | + else |
| 8014 | + $.datepicker._showDatepicker(target); |
| 8015 | + return false; |
| 8016 | + }); |
| 8017 | + } |
| 8018 | + input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress). |
| 8019 | + bind("setData.datepicker", function(event, key, value) { |
| 8020 | + inst.settings[key] = value; |
| 8021 | + }).bind("getData.datepicker", function(event, key) { |
| 8022 | + return this._get(inst, key); |
| 8023 | + }); |
| 8024 | + $.data(target, PROP_NAME, inst); |
| 8025 | + }, |
| 8026 | + |
| 8027 | + /* Attach an inline date picker to a div. */ |
| 8028 | + _inlineDatepicker: function(target, inst) { |
| 8029 | + var divSpan = $(target); |
| 8030 | + if (divSpan.hasClass(this.markerClassName)) |
| 8031 | + return; |
| 8032 | + divSpan.addClass(this.markerClassName).append(inst.dpDiv). |
| 8033 | + bind("setData.datepicker", function(event, key, value){ |
| 8034 | + inst.settings[key] = value; |
| 8035 | + }).bind("getData.datepicker", function(event, key){ |
| 8036 | + return this._get(inst, key); |
| 8037 | + }); |
| 8038 | + $.data(target, PROP_NAME, inst); |
| 8039 | + this._setDate(inst, this._getDefaultDate(inst)); |
| 8040 | + this._updateDatepicker(inst); |
| 8041 | + this._updateAlternate(inst); |
| 8042 | + }, |
| 8043 | + |
| 8044 | + /* Pop-up the date picker in a "dialog" box. |
| 8045 | + @param input element - ignored |
| 8046 | + @param dateText string - the initial date to display (in the current format) |
| 8047 | + @param onSelect function - the function(dateText) to call when a date is selected |
| 8048 | + @param settings object - update the dialog date picker instance's settings (anonymous object) |
| 8049 | + @param pos int[2] - coordinates for the dialog's position within the screen or |
| 8050 | + event - with x/y coordinates or |
| 8051 | + leave empty for default (screen centre) |
| 8052 | + @return the manager object */ |
| 8053 | + _dialogDatepicker: function(input, dateText, onSelect, settings, pos) { |
| 8054 | + var inst = this._dialogInst; // internal instance |
| 8055 | + if (!inst) { |
| 8056 | + var id = 'dp' + (++this.uuid); |
| 8057 | + this._dialogInput = $('<input type="text" id="' + id + |
| 8058 | + '" size="1" style="position: absolute; top: -100px;"/>'); |
| 8059 | + this._dialogInput.keydown(this._doKeyDown); |
| 8060 | + $('body').append(this._dialogInput); |
| 8061 | + inst = this._dialogInst = this._newInst(this._dialogInput, false); |
| 8062 | + inst.settings = {}; |
| 8063 | + $.data(this._dialogInput[0], PROP_NAME, inst); |
| 8064 | + } |
| 8065 | + extendRemove(inst.settings, settings || {}); |
| 8066 | + this._dialogInput.val(dateText); |
| 8067 | + |
| 8068 | + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); |
| 8069 | + if (!this._pos) { |
| 8070 | + var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; |
| 8071 | + var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; |
| 8072 | + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; |
| 8073 | + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; |
| 8074 | + this._pos = // should use actual width/height below |
| 8075 | + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; |
| 8076 | + } |
| 8077 | + |
| 8078 | + // move input on screen for focus, but hidden behind dialog |
| 8079 | + this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px'); |
| 8080 | + inst.settings.onSelect = onSelect; |
| 8081 | + this._inDialog = true; |
| 8082 | + this.dpDiv.addClass(this._dialogClass); |
| 8083 | + this._showDatepicker(this._dialogInput[0]); |
| 8084 | + if ($.blockUI) |
| 8085 | + $.blockUI(this.dpDiv); |
| 8086 | + $.data(this._dialogInput[0], PROP_NAME, inst); |
| 8087 | + return this; |
| 8088 | + }, |
| 8089 | + |
| 8090 | + /* Detach a datepicker from its control. |
| 8091 | + @param target element - the target input field or division or span */ |
| 8092 | + _destroyDatepicker: function(target) { |
| 8093 | + var $target = $(target); |
| 8094 | + var inst = $.data(target, PROP_NAME); |
| 8095 | + if (!$target.hasClass(this.markerClassName)) { |
| 8096 | + return; |
| 8097 | + } |
| 8098 | + var nodeName = target.nodeName.toLowerCase(); |
| 8099 | + $.removeData(target, PROP_NAME); |
| 8100 | + if (nodeName == 'input') { |
| 8101 | + inst.append.remove(); |
| 8102 | + inst.trigger.remove(); |
| 8103 | + $target.removeClass(this.markerClassName). |
| 8104 | + unbind('focus', this._showDatepicker). |
| 8105 | + unbind('keydown', this._doKeyDown). |
| 8106 | + unbind('keypress', this._doKeyPress); |
| 8107 | + } else if (nodeName == 'div' || nodeName == 'span') |
| 8108 | + $target.removeClass(this.markerClassName).empty(); |
| 8109 | + }, |
| 8110 | + |
| 8111 | + /* Enable the date picker to a jQuery selection. |
| 8112 | + @param target element - the target input field or division or span */ |
| 8113 | + _enableDatepicker: function(target) { |
| 8114 | + var $target = $(target); |
| 8115 | + var inst = $.data(target, PROP_NAME); |
| 8116 | + if (!$target.hasClass(this.markerClassName)) { |
| 8117 | + return; |
| 8118 | + } |
| 8119 | + var nodeName = target.nodeName.toLowerCase(); |
| 8120 | + if (nodeName == 'input') { |
| 8121 | + target.disabled = false; |
| 8122 | + inst.trigger.filter('button'). |
| 8123 | + each(function() { this.disabled = false; }).end(). |
| 8124 | + filter('img').css({opacity: '1.0', cursor: ''}); |
| 8125 | + } |
| 8126 | + else if (nodeName == 'div' || nodeName == 'span') { |
| 8127 | + var inline = $target.children('.' + this._inlineClass); |
| 8128 | + inline.children().removeClass('ui-state-disabled'); |
| 8129 | + } |
| 8130 | + this._disabledInputs = $.map(this._disabledInputs, |
| 8131 | + function(value) { return (value == target ? null : value); }); // delete entry |
| 8132 | + }, |
| 8133 | + |
| 8134 | + /* Disable the date picker to a jQuery selection. |
| 8135 | + @param target element - the target input field or division or span */ |
| 8136 | + _disableDatepicker: function(target) { |
| 8137 | + var $target = $(target); |
| 8138 | + var inst = $.data(target, PROP_NAME); |
| 8139 | + if (!$target.hasClass(this.markerClassName)) { |
| 8140 | + return; |
| 8141 | + } |
| 8142 | + var nodeName = target.nodeName.toLowerCase(); |
| 8143 | + if (nodeName == 'input') { |
| 8144 | + target.disabled = true; |
| 8145 | + inst.trigger.filter('button'). |
| 8146 | + each(function() { this.disabled = true; }).end(). |
| 8147 | + filter('img').css({opacity: '0.5', cursor: 'default'}); |
| 8148 | + } |
| 8149 | + else if (nodeName == 'div' || nodeName == 'span') { |
| 8150 | + var inline = $target.children('.' + this._inlineClass); |
| 8151 | + inline.children().addClass('ui-state-disabled'); |
| 8152 | + } |
| 8153 | + this._disabledInputs = $.map(this._disabledInputs, |
| 8154 | + function(value) { return (value == target ? null : value); }); // delete entry |
| 8155 | + this._disabledInputs[this._disabledInputs.length] = target; |
| 8156 | + }, |
| 8157 | + |
| 8158 | + /* Is the first field in a jQuery collection disabled as a datepicker? |
| 8159 | + @param target element - the target input field or division or span |
| 8160 | + @return boolean - true if disabled, false if enabled */ |
| 8161 | + _isDisabledDatepicker: function(target) { |
| 8162 | + if (!target) { |
| 8163 | + return false; |
| 8164 | + } |
| 8165 | + for (var i = 0; i < this._disabledInputs.length; i++) { |
| 8166 | + if (this._disabledInputs[i] == target) |
| 8167 | + return true; |
| 8168 | + } |
| 8169 | + return false; |
| 8170 | + }, |
| 8171 | + |
| 8172 | + /* Retrieve the instance data for the target control. |
| 8173 | + @param target element - the target input field or division or span |
| 8174 | + @return object - the associated instance data |
| 8175 | + @throws error if a jQuery problem getting data */ |
| 8176 | + _getInst: function(target) { |
| 8177 | + try { |
| 8178 | + return $.data(target, PROP_NAME); |
| 8179 | + } |
| 8180 | + catch (err) { |
| 8181 | + throw 'Missing instance data for this datepicker'; |
| 8182 | + } |
| 8183 | + }, |
| 8184 | + |
| 8185 | + /* Update or retrieve the settings for a date picker attached to an input field or division. |
| 8186 | + @param target element - the target input field or division or span |
| 8187 | + @param name object - the new settings to update or |
| 8188 | + string - the name of the setting to change or retrieve, |
| 8189 | + when retrieving also 'all' for all instance settings or |
| 8190 | + 'defaults' for all global defaults |
| 8191 | + @param value any - the new value for the setting |
| 8192 | + (omit if above is an object or to retrieve a value) */ |
| 8193 | + _optionDatepicker: function(target, name, value) { |
| 8194 | + var inst = this._getInst(target); |
| 8195 | + if (arguments.length == 2 && typeof name == 'string') { |
| 8196 | + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : |
| 8197 | + (inst ? (name == 'all' ? $.extend({}, inst.settings) : |
| 8198 | + this._get(inst, name)) : null)); |
| 8199 | + } |
| 8200 | + var settings = name || {}; |
| 8201 | + if (typeof name == 'string') { |
| 8202 | + settings = {}; |
| 8203 | + settings[name] = value; |
| 8204 | + } |
| 8205 | + if (inst) { |
| 8206 | + if (this._curInst == inst) { |
| 8207 | + this._hideDatepicker(null); |
| 8208 | + } |
| 8209 | + var date = this._getDateDatepicker(target); |
| 8210 | + extendRemove(inst.settings, settings); |
| 8211 | + this._setDateDatepicker(target, date); |
| 8212 | + this._updateDatepicker(inst); |
| 8213 | + } |
| 8214 | + }, |
| 8215 | + |
| 8216 | + // change method deprecated |
| 8217 | + _changeDatepicker: function(target, name, value) { |
| 8218 | + this._optionDatepicker(target, name, value); |
| 8219 | + }, |
| 8220 | + |
| 8221 | + /* Redraw the date picker attached to an input field or division. |
| 8222 | + @param target element - the target input field or division or span */ |
| 8223 | + _refreshDatepicker: function(target) { |
| 8224 | + var inst = this._getInst(target); |
| 8225 | + if (inst) { |
| 8226 | + this._updateDatepicker(inst); |
| 8227 | + } |
| 8228 | + }, |
| 8229 | + |
| 8230 | + /* Set the dates for a jQuery selection. |
| 8231 | + @param target element - the target input field or division or span |
| 8232 | + @param date Date - the new date |
| 8233 | + @param endDate Date - the new end date for a range (optional) */ |
| 8234 | + _setDateDatepicker: function(target, date, endDate) { |
| 8235 | + var inst = this._getInst(target); |
| 8236 | + if (inst) { |
| 8237 | + this._setDate(inst, date, endDate); |
| 8238 | + this._updateDatepicker(inst); |
| 8239 | + this._updateAlternate(inst); |
| 8240 | + } |
| 8241 | + }, |
| 8242 | + |
| 8243 | + /* Get the date(s) for the first entry in a jQuery selection. |
| 8244 | + @param target element - the target input field or division or span |
| 8245 | + @return Date - the current date or |
| 8246 | + Date[2] - the current dates for a range */ |
| 8247 | + _getDateDatepicker: function(target) { |
| 8248 | + var inst = this._getInst(target); |
| 8249 | + if (inst && !inst.inline) |
| 8250 | + this._setDateFromField(inst); |
| 8251 | + return (inst ? this._getDate(inst) : null); |
| 8252 | + }, |
| 8253 | + |
| 8254 | + /* Handle keystrokes. */ |
| 8255 | + _doKeyDown: function(event) { |
| 8256 | + var inst = $.datepicker._getInst(event.target); |
| 8257 | + var handled = true; |
| 8258 | + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); |
| 8259 | + inst._keyEvent = true; |
| 8260 | + if ($.datepicker._datepickerShowing) |
| 8261 | + switch (event.keyCode) { |
| 8262 | + case 9: $.datepicker._hideDatepicker(null, ''); |
| 8263 | + break; // hide on tab out |
| 8264 | + case 13: var sel = $('td.' + $.datepicker._dayOverClass + |
| 8265 | + ', td.' + $.datepicker._currentClass, inst.dpDiv); |
| 8266 | + if (sel[0]) |
| 8267 | + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); |
| 8268 | + else |
| 8269 | + $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); |
| 8270 | + return false; // don't submit the form |
| 8271 | + break; // select the value on enter |
| 8272 | + case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration')); |
| 8273 | + break; // hide on escape |
| 8274 | + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? |
| 8275 | + -$.datepicker._get(inst, 'stepBigMonths') : |
| 8276 | + -$.datepicker._get(inst, 'stepMonths')), 'M'); |
| 8277 | + break; // previous month/year on page up/+ ctrl |
| 8278 | + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? |
| 8279 | + +$.datepicker._get(inst, 'stepBigMonths') : |
| 8280 | + +$.datepicker._get(inst, 'stepMonths')), 'M'); |
| 8281 | + break; // next month/year on page down/+ ctrl |
| 8282 | + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); |
| 8283 | + handled = event.ctrlKey || event.metaKey; |
| 8284 | + break; // clear on ctrl or command +end |
| 8285 | + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); |
| 8286 | + handled = event.ctrlKey || event.metaKey; |
| 8287 | + break; // current on ctrl or command +home |
| 8288 | + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); |
| 8289 | + handled = event.ctrlKey || event.metaKey; |
| 8290 | + // -1 day on ctrl or command +left |
| 8291 | + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? |
| 8292 | + -$.datepicker._get(inst, 'stepBigMonths') : |
| 8293 | + -$.datepicker._get(inst, 'stepMonths')), 'M'); |
| 8294 | + // next month/year on alt +left on Mac |
| 8295 | + break; |
| 8296 | + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); |
| 8297 | + handled = event.ctrlKey || event.metaKey; |
| 8298 | + break; // -1 week on ctrl or command +up |
| 8299 | + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); |
| 8300 | + handled = event.ctrlKey || event.metaKey; |
| 8301 | + // +1 day on ctrl or command +right |
| 8302 | + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? |
| 8303 | + +$.datepicker._get(inst, 'stepBigMonths') : |
| 8304 | + +$.datepicker._get(inst, 'stepMonths')), 'M'); |
| 8305 | + // next month/year on alt +right |
| 8306 | + break; |
| 8307 | + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); |
| 8308 | + handled = event.ctrlKey || event.metaKey; |
| 8309 | + break; // +1 week on ctrl or command +down |
| 8310 | + default: handled = false; |
| 8311 | + } |
| 8312 | + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home |
| 8313 | + $.datepicker._showDatepicker(this); |
| 8314 | + else { |
| 8315 | + handled = false; |
| 8316 | + } |
| 8317 | + if (handled) { |
| 8318 | + event.preventDefault(); |
| 8319 | + event.stopPropagation(); |
| 8320 | + } |
| 8321 | + }, |
| 8322 | + |
| 8323 | + /* Filter entered characters - based on date format. */ |
| 8324 | + _doKeyPress: function(event) { |
| 8325 | + var inst = $.datepicker._getInst(event.target); |
| 8326 | + if ($.datepicker._get(inst, 'constrainInput')) { |
| 8327 | + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); |
| 8328 | + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); |
| 8329 | + return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); |
| 8330 | + } |
| 8331 | + }, |
| 8332 | + |
| 8333 | + /* Pop-up the date picker for a given input field. |
| 8334 | + @param input element - the input field attached to the date picker or |
| 8335 | + event - if triggered by focus */ |
| 8336 | + _showDatepicker: function(input) { |
| 8337 | + input = input.target || input; |
| 8338 | + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger |
| 8339 | + input = $('input', input.parentNode)[0]; |
| 8340 | + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here |
| 8341 | + return; |
| 8342 | + var inst = $.datepicker._getInst(input); |
| 8343 | + var beforeShow = $.datepicker._get(inst, 'beforeShow'); |
| 8344 | + extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); |
| 8345 | + $.datepicker._hideDatepicker(null, ''); |
| 8346 | + $.datepicker._lastInput = input; |
| 8347 | + $.datepicker._setDateFromField(inst); |
| 8348 | + if ($.datepicker._inDialog) // hide cursor |
| 8349 | + input.value = ''; |
| 8350 | + if (!$.datepicker._pos) { // position below input |
| 8351 | + $.datepicker._pos = $.datepicker._findPos(input); |
| 8352 | + $.datepicker._pos[1] += input.offsetHeight; // add the height |
| 8353 | + } |
| 8354 | + var isFixed = false; |
| 8355 | + $(input).parents().each(function() { |
| 8356 | + isFixed |= $(this).css('position') == 'fixed'; |
| 8357 | + return !isFixed; |
| 8358 | + }); |
| 8359 | + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled |
| 8360 | + $.datepicker._pos[0] -= document.documentElement.scrollLeft; |
| 8361 | + $.datepicker._pos[1] -= document.documentElement.scrollTop; |
| 8362 | + } |
| 8363 | + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; |
| 8364 | + $.datepicker._pos = null; |
| 8365 | + inst.rangeStart = null; |
| 8366 | + // determine sizing offscreen |
| 8367 | + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); |
| 8368 | + $.datepicker._updateDatepicker(inst); |
| 8369 | + // fix width for dynamic number of date pickers |
| 8370 | + // and adjust position before showing |
| 8371 | + offset = $.datepicker._checkOffset(inst, offset, isFixed); |
| 8372 | + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? |
| 8373 | + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', |
| 8374 | + left: offset.left + 'px', top: offset.top + 'px'}); |
| 8375 | + if (!inst.inline) { |
| 8376 | + var showAnim = $.datepicker._get(inst, 'showAnim') || 'show'; |
| 8377 | + var duration = $.datepicker._get(inst, 'duration'); |
| 8378 | + var postProcess = function() { |
| 8379 | + $.datepicker._datepickerShowing = true; |
| 8380 | + if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems |
| 8381 | + $('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4, |
| 8382 | + height: inst.dpDiv.height() + 4}); |
| 8383 | + }; |
| 8384 | + if ($.effects && $.effects[showAnim]) |
| 8385 | + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); |
| 8386 | + else |
| 8387 | + inst.dpDiv[showAnim](duration, postProcess); |
| 8388 | + if (duration == '') |
| 8389 | + postProcess(); |
| 8390 | + if (inst.input[0].type != 'hidden') |
| 8391 | + inst.input[0].focus(); |
| 8392 | + $.datepicker._curInst = inst; |
| 8393 | + } |
| 8394 | + }, |
| 8395 | + |
| 8396 | + /* Generate the date picker content. */ |
| 8397 | + _updateDatepicker: function(inst) { |
| 8398 | + var dims = {width: inst.dpDiv.width() + 4, |
| 8399 | + height: inst.dpDiv.height() + 4}; |
| 8400 | + var self = this; |
| 8401 | + inst.dpDiv.empty().append(this._generateHTML(inst)) |
| 8402 | + .find('iframe.ui-datepicker-cover'). |
| 8403 | + css({width: dims.width, height: dims.height}) |
| 8404 | + .end() |
| 8405 | + .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') |
| 8406 | + .bind('mouseout', function(){ |
| 8407 | + $(this).removeClass('ui-state-hover'); |
| 8408 | + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); |
| 8409 | + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); |
| 8410 | + }) |
| 8411 | + .bind('mouseover', function(){ |
| 8412 | + if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { |
| 8413 | + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); |
| 8414 | + $(this).addClass('ui-state-hover'); |
| 8415 | + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); |
| 8416 | + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); |
| 8417 | + } |
| 8418 | + }) |
| 8419 | + .end() |
| 8420 | + .find('.' + this._dayOverClass + ' a') |
| 8421 | + .trigger('mouseover') |
| 8422 | + .end(); |
| 8423 | + var numMonths = this._getNumberOfMonths(inst); |
| 8424 | + var cols = numMonths[1]; |
| 8425 | + var width = 17; |
| 8426 | + if (cols > 1) { |
| 8427 | + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); |
| 8428 | + } else { |
| 8429 | + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); |
| 8430 | + } |
| 8431 | + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + |
| 8432 | + 'Class']('ui-datepicker-multi'); |
| 8433 | + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + |
| 8434 | + 'Class']('ui-datepicker-rtl'); |
| 8435 | + if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst) |
| 8436 | + $(inst.input[0]).focus(); |
| 8437 | + }, |
| 8438 | + |
| 8439 | + /* Check positioning to remain on screen. */ |
| 8440 | + _checkOffset: function(inst, offset, isFixed) { |
| 8441 | + var dpWidth = inst.dpDiv.outerWidth(); |
| 8442 | + var dpHeight = inst.dpDiv.outerHeight(); |
| 8443 | + var inputWidth = inst.input ? inst.input.outerWidth() : 0; |
| 8444 | + var inputHeight = inst.input ? inst.input.outerHeight() : 0; |
| 8445 | + var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft(); |
| 8446 | + var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop(); |
| 8447 | + |
| 8448 | + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); |
| 8449 | + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; |
| 8450 | + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; |
| 8451 | + |
| 8452 | + // now check if datepicker is showing outside window viewport - move to a better place if so. |
| 8453 | + offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0; |
| 8454 | + offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0; |
| 8455 | + |
| 8456 | + return offset; |
| 8457 | + }, |
| 8458 | + |
| 8459 | + /* Find an object's position on the screen. */ |
| 8460 | + _findPos: function(obj) { |
| 8461 | + while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { |
| 8462 | + obj = obj.nextSibling; |
| 8463 | + } |
| 8464 | + var position = $(obj).offset(); |
| 8465 | + return [position.left, position.top]; |
| 8466 | + }, |
| 8467 | + |
| 8468 | + /* Hide the date picker from view. |
| 8469 | + @param input element - the input field attached to the date picker |
| 8470 | + @param duration string - the duration over which to close the date picker */ |
| 8471 | + _hideDatepicker: function(input, duration) { |
| 8472 | + var inst = this._curInst; |
| 8473 | + if (!inst || (input && inst != $.data(input, PROP_NAME))) |
| 8474 | + return; |
| 8475 | + if (inst.stayOpen) |
| 8476 | + this._selectDate('#' + inst.id, this._formatDate(inst, |
| 8477 | + inst.currentDay, inst.currentMonth, inst.currentYear)); |
| 8478 | + inst.stayOpen = false; |
| 8479 | + if (this._datepickerShowing) { |
| 8480 | + duration = (duration != null ? duration : this._get(inst, 'duration')); |
| 8481 | + var showAnim = this._get(inst, 'showAnim'); |
| 8482 | + var postProcess = function() { |
| 8483 | + $.datepicker._tidyDialog(inst); |
| 8484 | + }; |
| 8485 | + if (duration != '' && $.effects && $.effects[showAnim]) |
| 8486 | + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), |
| 8487 | + duration, postProcess); |
| 8488 | + else |
| 8489 | + inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' : |
| 8490 | + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess); |
| 8491 | + if (duration == '') |
| 8492 | + this._tidyDialog(inst); |
| 8493 | + var onClose = this._get(inst, 'onClose'); |
| 8494 | + if (onClose) |
| 8495 | + onClose.apply((inst.input ? inst.input[0] : null), |
| 8496 | + [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback |
| 8497 | + this._datepickerShowing = false; |
| 8498 | + this._lastInput = null; |
| 8499 | + if (this._inDialog) { |
| 8500 | + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); |
| 8501 | + if ($.blockUI) { |
| 8502 | + $.unblockUI(); |
| 8503 | + $('body').append(this.dpDiv); |
| 8504 | + } |
| 8505 | + } |
| 8506 | + this._inDialog = false; |
| 8507 | + } |
| 8508 | + this._curInst = null; |
| 8509 | + }, |
| 8510 | + |
| 8511 | + /* Tidy up after a dialog display. */ |
| 8512 | + _tidyDialog: function(inst) { |
| 8513 | + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); |
| 8514 | + }, |
| 8515 | + |
| 8516 | + /* Close date picker if clicked elsewhere. */ |
| 8517 | + _checkExternalClick: function(event) { |
| 8518 | + if (!$.datepicker._curInst) |
| 8519 | + return; |
| 8520 | + var $target = $(event.target); |
| 8521 | + if (($target.parents('#' + $.datepicker._mainDivId).length == 0) && |
| 8522 | + !$target.hasClass($.datepicker.markerClassName) && |
| 8523 | + !$target.hasClass($.datepicker._triggerClass) && |
| 8524 | + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) |
| 8525 | + $.datepicker._hideDatepicker(null, ''); |
| 8526 | + }, |
| 8527 | + |
| 8528 | + /* Adjust one of the date sub-fields. */ |
| 8529 | + _adjustDate: function(id, offset, period) { |
| 8530 | + var target = $(id); |
| 8531 | + var inst = this._getInst(target[0]); |
| 8532 | + if (this._isDisabledDatepicker(target[0])) { |
| 8533 | + return; |
| 8534 | + } |
| 8535 | + this._adjustInstDate(inst, offset + |
| 8536 | + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning |
| 8537 | + period); |
| 8538 | + this._updateDatepicker(inst); |
| 8539 | + }, |
| 8540 | + |
| 8541 | + /* Action for current link. */ |
| 8542 | + _gotoToday: function(id) { |
| 8543 | + var target = $(id); |
| 8544 | + var inst = this._getInst(target[0]); |
| 8545 | + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { |
| 8546 | + inst.selectedDay = inst.currentDay; |
| 8547 | + inst.drawMonth = inst.selectedMonth = inst.currentMonth; |
| 8548 | + inst.drawYear = inst.selectedYear = inst.currentYear; |
| 8549 | + } |
| 8550 | + else { |
| 8551 | + var date = new Date(); |
| 8552 | + inst.selectedDay = date.getDate(); |
| 8553 | + inst.drawMonth = inst.selectedMonth = date.getMonth(); |
| 8554 | + inst.drawYear = inst.selectedYear = date.getFullYear(); |
| 8555 | + } |
| 8556 | + this._notifyChange(inst); |
| 8557 | + this._adjustDate(target); |
| 8558 | + }, |
| 8559 | + |
| 8560 | + /* Action for selecting a new month/year. */ |
| 8561 | + _selectMonthYear: function(id, select, period) { |
| 8562 | + var target = $(id); |
| 8563 | + var inst = this._getInst(target[0]); |
| 8564 | + inst._selectingMonthYear = false; |
| 8565 | + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = |
| 8566 | + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = |
| 8567 | + parseInt(select.options[select.selectedIndex].value,10); |
| 8568 | + this._notifyChange(inst); |
| 8569 | + this._adjustDate(target); |
| 8570 | + }, |
| 8571 | + |
| 8572 | + /* Restore input focus after not changing month/year. */ |
| 8573 | + _clickMonthYear: function(id) { |
| 8574 | + var target = $(id); |
| 8575 | + var inst = this._getInst(target[0]); |
| 8576 | + if (inst.input && inst._selectingMonthYear && !$.browser.msie) |
| 8577 | + inst.input[0].focus(); |
| 8578 | + inst._selectingMonthYear = !inst._selectingMonthYear; |
| 8579 | + }, |
| 8580 | + |
| 8581 | + /* Action for selecting a day. */ |
| 8582 | + _selectDay: function(id, month, year, td) { |
| 8583 | + var target = $(id); |
| 8584 | + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { |
| 8585 | + return; |
| 8586 | + } |
| 8587 | + var inst = this._getInst(target[0]); |
| 8588 | + inst.selectedDay = inst.currentDay = $('a', td).html(); |
| 8589 | + inst.selectedMonth = inst.currentMonth = month; |
| 8590 | + inst.selectedYear = inst.currentYear = year; |
| 8591 | + if (inst.stayOpen) { |
| 8592 | + inst.endDay = inst.endMonth = inst.endYear = null; |
| 8593 | + } |
| 8594 | + this._selectDate(id, this._formatDate(inst, |
| 8595 | + inst.currentDay, inst.currentMonth, inst.currentYear)); |
| 8596 | + if (inst.stayOpen) { |
| 8597 | + inst.rangeStart = this._daylightSavingAdjust( |
| 8598 | + new Date(inst.currentYear, inst.currentMonth, inst.currentDay)); |
| 8599 | + this._updateDatepicker(inst); |
| 8600 | + } |
| 8601 | + }, |
| 8602 | + |
| 8603 | + /* Erase the input field and hide the date picker. */ |
| 8604 | + _clearDate: function(id) { |
| 8605 | + var target = $(id); |
| 8606 | + var inst = this._getInst(target[0]); |
| 8607 | + inst.stayOpen = false; |
| 8608 | + inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null; |
| 8609 | + this._selectDate(target, ''); |
| 8610 | + }, |
| 8611 | + |
| 8612 | + /* Update the input field with the selected date. */ |
| 8613 | + _selectDate: function(id, dateStr) { |
| 8614 | + var target = $(id); |
| 8615 | + var inst = this._getInst(target[0]); |
| 8616 | + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); |
| 8617 | + if (inst.input) |
| 8618 | + inst.input.val(dateStr); |
| 8619 | + this._updateAlternate(inst); |
| 8620 | + var onSelect = this._get(inst, 'onSelect'); |
| 8621 | + if (onSelect) |
| 8622 | + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback |
| 8623 | + else if (inst.input) |
| 8624 | + inst.input.trigger('change'); // fire the change event |
| 8625 | + if (inst.inline) |
| 8626 | + this._updateDatepicker(inst); |
| 8627 | + else if (!inst.stayOpen) { |
| 8628 | + this._hideDatepicker(null, this._get(inst, 'duration')); |
| 8629 | + this._lastInput = inst.input[0]; |
| 8630 | + if (typeof(inst.input[0]) != 'object') |
| 8631 | + inst.input[0].focus(); // restore focus |
| 8632 | + this._lastInput = null; |
| 8633 | + } |
| 8634 | + }, |
| 8635 | + |
| 8636 | + /* Update any alternate field to synchronise with the main field. */ |
| 8637 | + _updateAlternate: function(inst) { |
| 8638 | + var altField = this._get(inst, 'altField'); |
| 8639 | + if (altField) { // update alternate field too |
| 8640 | + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); |
| 8641 | + var date = this._getDate(inst); |
| 8642 | + dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); |
| 8643 | + $(altField).each(function() { $(this).val(dateStr); }); |
| 8644 | + } |
| 8645 | + }, |
| 8646 | + |
| 8647 | + /* Set as beforeShowDay function to prevent selection of weekends. |
| 8648 | + @param date Date - the date to customise |
| 8649 | + @return [boolean, string] - is this date selectable?, what is its CSS class? */ |
| 8650 | + noWeekends: function(date) { |
| 8651 | + var day = date.getDay(); |
| 8652 | + return [(day > 0 && day < 6), '']; |
| 8653 | + }, |
| 8654 | + |
| 8655 | + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. |
| 8656 | + @param date Date - the date to get the week for |
| 8657 | + @return number - the number of the week within the year that contains this date */ |
| 8658 | + iso8601Week: function(date) { |
| 8659 | + var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); |
| 8660 | + var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan |
| 8661 | + var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7 |
| 8662 | + firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday |
| 8663 | + if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary |
| 8664 | + checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year |
| 8665 | + return $.datepicker.iso8601Week(checkDate); |
| 8666 | + } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year |
| 8667 | + firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7; |
| 8668 | + if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary |
| 8669 | + return 1; |
| 8670 | + } |
| 8671 | + } |
| 8672 | + return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date |
| 8673 | + }, |
| 8674 | + |
| 8675 | + /* Parse a string value into a date object. |
| 8676 | + See formatDate below for the possible formats. |
| 8677 | + |
| 8678 | + @param format string - the expected format of the date |
| 8679 | + @param value string - the date in the above format |
| 8680 | + @param settings Object - attributes include: |
| 8681 | + shortYearCutoff number - the cutoff year for determining the century (optional) |
| 8682 | + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) |
| 8683 | + dayNames string[7] - names of the days from Sunday (optional) |
| 8684 | + monthNamesShort string[12] - abbreviated names of the months (optional) |
| 8685 | + monthNames string[12] - names of the months (optional) |
| 8686 | + @return Date - the extracted date value or null if value is blank */ |
| 8687 | + parseDate: function (format, value, settings) { |
| 8688 | + if (format == null || value == null) |
| 8689 | + throw 'Invalid arguments'; |
| 8690 | + value = (typeof value == 'object' ? value.toString() : value + ''); |
| 8691 | + if (value == '') |
| 8692 | + return null; |
| 8693 | + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; |
| 8694 | + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; |
| 8695 | + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; |
| 8696 | + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; |
| 8697 | + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; |
| 8698 | + var year = -1; |
| 8699 | + var month = -1; |
| 8700 | + var day = -1; |
| 8701 | + var doy = -1; |
| 8702 | + var literal = false; |
| 8703 | + // Check whether a format character is doubled |
| 8704 | + var lookAhead = function(match) { |
| 8705 | + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); |
| 8706 | + if (matches) |
| 8707 | + iFormat++; |
| 8708 | + return matches; |
| 8709 | + }; |
| 8710 | + // Extract a number from the string value |
| 8711 | + var getNumber = function(match) { |
| 8712 | + lookAhead(match); |
| 8713 | + var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2))); |
| 8714 | + var size = origSize; |
| 8715 | + var num = 0; |
| 8716 | + while (size > 0 && iValue < value.length && |
| 8717 | + value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') { |
| 8718 | + num = num * 10 + parseInt(value.charAt(iValue++),10); |
| 8719 | + size--; |
| 8720 | + } |
| 8721 | + if (size == origSize) |
| 8722 | + throw 'Missing number at position ' + iValue; |
| 8723 | + return num; |
| 8724 | + }; |
| 8725 | + // Extract a name from the string value and convert to an index |
| 8726 | + var getName = function(match, shortNames, longNames) { |
| 8727 | + var names = (lookAhead(match) ? longNames : shortNames); |
| 8728 | + var size = 0; |
| 8729 | + for (var j = 0; j < names.length; j++) |
| 8730 | + size = Math.max(size, names[j].length); |
| 8731 | + var name = ''; |
| 8732 | + var iInit = iValue; |
| 8733 | + while (size > 0 && iValue < value.length) { |
| 8734 | + name += value.charAt(iValue++); |
| 8735 | + for (var i = 0; i < names.length; i++) |
| 8736 | + if (name == names[i]) |
| 8737 | + return i + 1; |
| 8738 | + size--; |
| 8739 | + } |
| 8740 | + throw 'Unknown name at position ' + iInit; |
| 8741 | + }; |
| 8742 | + // Confirm that a literal character matches the string value |
| 8743 | + var checkLiteral = function() { |
| 8744 | + if (value.charAt(iValue) != format.charAt(iFormat)) |
| 8745 | + throw 'Unexpected literal at position ' + iValue; |
| 8746 | + iValue++; |
| 8747 | + }; |
| 8748 | + var iValue = 0; |
| 8749 | + for (var iFormat = 0; iFormat < format.length; iFormat++) { |
| 8750 | + if (literal) |
| 8751 | + if (format.charAt(iFormat) == "'" && !lookAhead("'")) |
| 8752 | + literal = false; |
| 8753 | + else |
| 8754 | + checkLiteral(); |
| 8755 | + else |
| 8756 | + switch (format.charAt(iFormat)) { |
| 8757 | + case 'd': |
| 8758 | + day = getNumber('d'); |
| 8759 | + break; |
| 8760 | + case 'D': |
| 8761 | + getName('D', dayNamesShort, dayNames); |
| 8762 | + break; |
| 8763 | + case 'o': |
| 8764 | + doy = getNumber('o'); |
| 8765 | + break; |
| 8766 | + case 'm': |
| 8767 | + month = getNumber('m'); |
| 8768 | + break; |
| 8769 | + case 'M': |
| 8770 | + month = getName('M', monthNamesShort, monthNames); |
| 8771 | + break; |
| 8772 | + case 'y': |
| 8773 | + year = getNumber('y'); |
| 8774 | + break; |
| 8775 | + case '@': |
| 8776 | + var date = new Date(getNumber('@')); |
| 8777 | + year = date.getFullYear(); |
| 8778 | + month = date.getMonth() + 1; |
| 8779 | + day = date.getDate(); |
| 8780 | + break; |
| 8781 | + case "'": |
| 8782 | + if (lookAhead("'")) |
| 8783 | + checkLiteral(); |
| 8784 | + else |
| 8785 | + literal = true; |
| 8786 | + break; |
| 8787 | + default: |
| 8788 | + checkLiteral(); |
| 8789 | + } |
| 8790 | + } |
| 8791 | + if (year == -1) |
| 8792 | + year = new Date().getFullYear(); |
| 8793 | + else if (year < 100) |
| 8794 | + year += new Date().getFullYear() - new Date().getFullYear() % 100 + |
| 8795 | + (year <= shortYearCutoff ? 0 : -100); |
| 8796 | + if (doy > -1) { |
| 8797 | + month = 1; |
| 8798 | + day = doy; |
| 8799 | + do { |
| 8800 | + var dim = this._getDaysInMonth(year, month - 1); |
| 8801 | + if (day <= dim) |
| 8802 | + break; |
| 8803 | + month++; |
| 8804 | + day -= dim; |
| 8805 | + } while (true); |
| 8806 | + } |
| 8807 | + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); |
| 8808 | + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) |
| 8809 | + throw 'Invalid date'; // E.g. 31/02/* |
| 8810 | + return date; |
| 8811 | + }, |
| 8812 | + |
| 8813 | + /* Standard date formats. */ |
| 8814 | + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) |
| 8815 | + COOKIE: 'D, dd M yy', |
| 8816 | + ISO_8601: 'yy-mm-dd', |
| 8817 | + RFC_822: 'D, d M y', |
| 8818 | + RFC_850: 'DD, dd-M-y', |
| 8819 | + RFC_1036: 'D, d M y', |
| 8820 | + RFC_1123: 'D, d M yy', |
| 8821 | + RFC_2822: 'D, d M yy', |
| 8822 | + RSS: 'D, d M y', // RFC 822 |
| 8823 | + TIMESTAMP: '@', |
| 8824 | + W3C: 'yy-mm-dd', // ISO 8601 |
| 8825 | + |
| 8826 | + /* Format a date object into a string value. |
| 8827 | + The format can be combinations of the following: |
| 8828 | + d - day of month (no leading zero) |
| 8829 | + dd - day of month (two digit) |
| 8830 | + o - day of year (no leading zeros) |
| 8831 | + oo - day of year (three digit) |
| 8832 | + D - day name short |
| 8833 | + DD - day name long |
| 8834 | + m - month of year (no leading zero) |
| 8835 | + mm - month of year (two digit) |
| 8836 | + M - month name short |
| 8837 | + MM - month name long |
| 8838 | + y - year (two digit) |
| 8839 | + yy - year (four digit) |
| 8840 | + @ - Unix timestamp (ms since 01/01/1970) |
| 8841 | + '...' - literal text |
| 8842 | + '' - single quote |
| 8843 | + |
| 8844 | + @param format string - the desired format of the date |
| 8845 | + @param date Date - the date value to format |
| 8846 | + @param settings Object - attributes include: |
| 8847 | + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) |
| 8848 | + dayNames string[7] - names of the days from Sunday (optional) |
| 8849 | + monthNamesShort string[12] - abbreviated names of the months (optional) |
| 8850 | + monthNames string[12] - names of the months (optional) |
| 8851 | + @return string - the date in the above format */ |
| 8852 | + formatDate: function (format, date, settings) { |
| 8853 | + if (!date) |
| 8854 | + return ''; |
| 8855 | + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; |
| 8856 | + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; |
| 8857 | + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; |
| 8858 | + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; |
| 8859 | + // Check whether a format character is doubled |
| 8860 | + var lookAhead = function(match) { |
| 8861 | + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); |
| 8862 | + if (matches) |
| 8863 | + iFormat++; |
| 8864 | + return matches; |
| 8865 | + }; |
| 8866 | + // Format a number, with leading zero if necessary |
| 8867 | + var formatNumber = function(match, value, len) { |
| 8868 | + var num = '' + value; |
| 8869 | + if (lookAhead(match)) |
| 8870 | + while (num.length < len) |
| 8871 | + num = '0' + num; |
| 8872 | + return num; |
| 8873 | + }; |
| 8874 | + // Format a name, short or long as requested |
| 8875 | + var formatName = function(match, value, shortNames, longNames) { |
| 8876 | + return (lookAhead(match) ? longNames[value] : shortNames[value]); |
| 8877 | + }; |
| 8878 | + var output = ''; |
| 8879 | + var literal = false; |
| 8880 | + if (date) |
| 8881 | + for (var iFormat = 0; iFormat < format.length; iFormat++) { |
| 8882 | + if (literal) |
| 8883 | + if (format.charAt(iFormat) == "'" && !lookAhead("'")) |
| 8884 | + literal = false; |
| 8885 | + else |
| 8886 | + output += format.charAt(iFormat); |
| 8887 | + else |
| 8888 | + switch (format.charAt(iFormat)) { |
| 8889 | + case 'd': |
| 8890 | + output += formatNumber('d', date.getDate(), 2); |
| 8891 | + break; |
| 8892 | + case 'D': |
| 8893 | + output += formatName('D', date.getDay(), dayNamesShort, dayNames); |
| 8894 | + break; |
| 8895 | + case 'o': |
| 8896 | + var doy = date.getDate(); |
| 8897 | + for (var m = date.getMonth() - 1; m >= 0; m--) |
| 8898 | + doy += this._getDaysInMonth(date.getFullYear(), m); |
| 8899 | + output += formatNumber('o', doy, 3); |
| 8900 | + break; |
| 8901 | + case 'm': |
| 8902 | + output += formatNumber('m', date.getMonth() + 1, 2); |
| 8903 | + break; |
| 8904 | + case 'M': |
| 8905 | + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); |
| 8906 | + break; |
| 8907 | + case 'y': |
| 8908 | + output += (lookAhead('y') ? date.getFullYear() : |
| 8909 | + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); |
| 8910 | + break; |
| 8911 | + case '@': |
| 8912 | + output += date.getTime(); |
| 8913 | + break; |
| 8914 | + case "'": |
| 8915 | + if (lookAhead("'")) |
| 8916 | + output += "'"; |
| 8917 | + else |
| 8918 | + literal = true; |
| 8919 | + break; |
| 8920 | + default: |
| 8921 | + output += format.charAt(iFormat); |
| 8922 | + } |
| 8923 | + } |
| 8924 | + return output; |
| 8925 | + }, |
| 8926 | + |
| 8927 | + /* Extract all possible characters from the date format. */ |
| 8928 | + _possibleChars: function (format) { |
| 8929 | + var chars = ''; |
| 8930 | + var literal = false; |
| 8931 | + for (var iFormat = 0; iFormat < format.length; iFormat++) |
| 8932 | + if (literal) |
| 8933 | + if (format.charAt(iFormat) == "'" && !lookAhead("'")) |
| 8934 | + literal = false; |
| 8935 | + else |
| 8936 | + chars += format.charAt(iFormat); |
| 8937 | + else |
| 8938 | + switch (format.charAt(iFormat)) { |
| 8939 | + case 'd': case 'm': case 'y': case '@': |
| 8940 | + chars += '0123456789'; |
| 8941 | + break; |
| 8942 | + case 'D': case 'M': |
| 8943 | + return null; // Accept anything |
| 8944 | + case "'": |
| 8945 | + if (lookAhead("'")) |
| 8946 | + chars += "'"; |
| 8947 | + else |
| 8948 | + literal = true; |
| 8949 | + break; |
| 8950 | + default: |
| 8951 | + chars += format.charAt(iFormat); |
| 8952 | + } |
| 8953 | + return chars; |
| 8954 | + }, |
| 8955 | + |
| 8956 | + /* Get a setting value, defaulting if necessary. */ |
| 8957 | + _get: function(inst, name) { |
| 8958 | + return inst.settings[name] !== undefined ? |
| 8959 | + inst.settings[name] : this._defaults[name]; |
| 8960 | + }, |
| 8961 | + |
| 8962 | + /* Parse existing date and initialise date picker. */ |
| 8963 | + _setDateFromField: function(inst) { |
| 8964 | + var dateFormat = this._get(inst, 'dateFormat'); |
| 8965 | + var dates = inst.input ? inst.input.val() : null; |
| 8966 | + inst.endDay = inst.endMonth = inst.endYear = null; |
| 8967 | + var date = defaultDate = this._getDefaultDate(inst); |
| 8968 | + var settings = this._getFormatConfig(inst); |
| 8969 | + try { |
| 8970 | + date = this.parseDate(dateFormat, dates, settings) || defaultDate; |
| 8971 | + } catch (event) { |
| 8972 | + this.log(event); |
| 8973 | + date = defaultDate; |
| 8974 | + } |
| 8975 | + inst.selectedDay = date.getDate(); |
| 8976 | + inst.drawMonth = inst.selectedMonth = date.getMonth(); |
| 8977 | + inst.drawYear = inst.selectedYear = date.getFullYear(); |
| 8978 | + inst.currentDay = (dates ? date.getDate() : 0); |
| 8979 | + inst.currentMonth = (dates ? date.getMonth() : 0); |
| 8980 | + inst.currentYear = (dates ? date.getFullYear() : 0); |
| 8981 | + this._adjustInstDate(inst); |
| 8982 | + }, |
| 8983 | + |
| 8984 | + /* Retrieve the default date shown on opening. */ |
| 8985 | + _getDefaultDate: function(inst) { |
| 8986 | + var date = this._determineDate(this._get(inst, 'defaultDate'), new Date()); |
| 8987 | + var minDate = this._getMinMaxDate(inst, 'min', true); |
| 8988 | + var maxDate = this._getMinMaxDate(inst, 'max'); |
| 8989 | + date = (minDate && date < minDate ? minDate : date); |
| 8990 | + date = (maxDate && date > maxDate ? maxDate : date); |
| 8991 | + return date; |
| 8992 | + }, |
| 8993 | + |
| 8994 | + /* A date may be specified as an exact value or a relative one. */ |
| 8995 | + _determineDate: function(date, defaultDate) { |
| 8996 | + var offsetNumeric = function(offset) { |
| 8997 | + var date = new Date(); |
| 8998 | + date.setDate(date.getDate() + offset); |
| 8999 | + return date; |
| 9000 | + }; |
| 9001 | + var offsetString = function(offset, getDaysInMonth) { |
| 9002 | + var date = new Date(); |
| 9003 | + var year = date.getFullYear(); |
| 9004 | + var month = date.getMonth(); |
| 9005 | + var day = date.getDate(); |
| 9006 | + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; |
| 9007 | + var matches = pattern.exec(offset); |
| 9008 | + while (matches) { |
| 9009 | + switch (matches[2] || 'd') { |
| 9010 | + case 'd' : case 'D' : |
| 9011 | + day += parseInt(matches[1],10); break; |
| 9012 | + case 'w' : case 'W' : |
| 9013 | + day += parseInt(matches[1],10) * 7; break; |
| 9014 | + case 'm' : case 'M' : |
| 9015 | + month += parseInt(matches[1],10); |
| 9016 | + day = Math.min(day, getDaysInMonth(year, month)); |
| 9017 | + break; |
| 9018 | + case 'y': case 'Y' : |
| 9019 | + year += parseInt(matches[1],10); |
| 9020 | + day = Math.min(day, getDaysInMonth(year, month)); |
| 9021 | + break; |
| 9022 | + } |
| 9023 | + matches = pattern.exec(offset); |
| 9024 | + } |
| 9025 | + return new Date(year, month, day); |
| 9026 | + }; |
| 9027 | + date = (date == null ? defaultDate : |
| 9028 | + (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) : |
| 9029 | + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); |
| 9030 | + date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); |
| 9031 | + if (date) { |
| 9032 | + date.setHours(0); |
| 9033 | + date.setMinutes(0); |
| 9034 | + date.setSeconds(0); |
| 9035 | + date.setMilliseconds(0); |
| 9036 | + } |
| 9037 | + return this._daylightSavingAdjust(date); |
| 9038 | + }, |
| 9039 | + |
| 9040 | + /* Handle switch to/from daylight saving. |
| 9041 | + Hours may be non-zero on daylight saving cut-over: |
| 9042 | + > 12 when midnight changeover, but then cannot generate |
| 9043 | + midnight datetime, so jump to 1AM, otherwise reset. |
| 9044 | + @param date (Date) the date to check |
| 9045 | + @return (Date) the corrected date */ |
| 9046 | + _daylightSavingAdjust: function(date) { |
| 9047 | + if (!date) return null; |
| 9048 | + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); |
| 9049 | + return date; |
| 9050 | + }, |
| 9051 | + |
| 9052 | + /* Set the date(s) directly. */ |
| 9053 | + _setDate: function(inst, date, endDate) { |
| 9054 | + var clear = !(date); |
| 9055 | + var origMonth = inst.selectedMonth; |
| 9056 | + var origYear = inst.selectedYear; |
| 9057 | + date = this._determineDate(date, new Date()); |
| 9058 | + inst.selectedDay = inst.currentDay = date.getDate(); |
| 9059 | + inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); |
| 9060 | + inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); |
| 9061 | + if (origMonth != inst.selectedMonth || origYear != inst.selectedYear) |
| 9062 | + this._notifyChange(inst); |
| 9063 | + this._adjustInstDate(inst); |
| 9064 | + if (inst.input) { |
| 9065 | + inst.input.val(clear ? '' : this._formatDate(inst)); |
| 9066 | + } |
| 9067 | + }, |
| 9068 | + |
| 9069 | + /* Retrieve the date(s) directly. */ |
| 9070 | + _getDate: function(inst) { |
| 9071 | + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : |
| 9072 | + this._daylightSavingAdjust(new Date( |
| 9073 | + inst.currentYear, inst.currentMonth, inst.currentDay))); |
| 9074 | + return startDate; |
| 9075 | + }, |
| 9076 | + |
| 9077 | + /* Generate the HTML for the current state of the date picker. */ |
| 9078 | + _generateHTML: function(inst) { |
| 9079 | + var today = new Date(); |
| 9080 | + today = this._daylightSavingAdjust( |
| 9081 | + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time |
| 9082 | + var isRTL = this._get(inst, 'isRTL'); |
| 9083 | + var showButtonPanel = this._get(inst, 'showButtonPanel'); |
| 9084 | + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); |
| 9085 | + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); |
| 9086 | + var numMonths = this._getNumberOfMonths(inst); |
| 9087 | + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); |
| 9088 | + var stepMonths = this._get(inst, 'stepMonths'); |
| 9089 | + var stepBigMonths = this._get(inst, 'stepBigMonths'); |
| 9090 | + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); |
| 9091 | + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : |
| 9092 | + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); |
| 9093 | + var minDate = this._getMinMaxDate(inst, 'min', true); |
| 9094 | + var maxDate = this._getMinMaxDate(inst, 'max'); |
| 9095 | + var drawMonth = inst.drawMonth - showCurrentAtPos; |
| 9096 | + var drawYear = inst.drawYear; |
| 9097 | + if (drawMonth < 0) { |
| 9098 | + drawMonth += 12; |
| 9099 | + drawYear--; |
| 9100 | + } |
| 9101 | + if (maxDate) { |
| 9102 | + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), |
| 9103 | + maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate())); |
| 9104 | + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); |
| 9105 | + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { |
| 9106 | + drawMonth--; |
| 9107 | + if (drawMonth < 0) { |
| 9108 | + drawMonth = 11; |
| 9109 | + drawYear--; |
| 9110 | + } |
| 9111 | + } |
| 9112 | + } |
| 9113 | + inst.drawMonth = drawMonth; |
| 9114 | + inst.drawYear = drawYear; |
| 9115 | + var prevText = this._get(inst, 'prevText'); |
| 9116 | + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, |
| 9117 | + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), |
| 9118 | + this._getFormatConfig(inst))); |
| 9119 | + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? |
| 9120 | + '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' + |
| 9121 | + ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : |
| 9122 | + (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>')); |
| 9123 | + var nextText = this._get(inst, 'nextText'); |
| 9124 | + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, |
| 9125 | + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), |
| 9126 | + this._getFormatConfig(inst))); |
| 9127 | + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? |
| 9128 | + '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' + |
| 9129 | + ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : |
| 9130 | + (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>')); |
| 9131 | + var currentText = this._get(inst, 'currentText'); |
| 9132 | + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); |
| 9133 | + currentText = (!navigationAsDateFormat ? currentText : |
| 9134 | + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); |
| 9135 | + 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>' : ''); |
| 9136 | + var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') + |
| 9137 | + (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 + '\');"' + |
| 9138 | + '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; |
| 9139 | + var firstDay = parseInt(this._get(inst, 'firstDay'),10); |
| 9140 | + firstDay = (isNaN(firstDay) ? 0 : firstDay); |
| 9141 | + var dayNames = this._get(inst, 'dayNames'); |
| 9142 | + var dayNamesShort = this._get(inst, 'dayNamesShort'); |
| 9143 | + var dayNamesMin = this._get(inst, 'dayNamesMin'); |
| 9144 | + var monthNames = this._get(inst, 'monthNames'); |
| 9145 | + var monthNamesShort = this._get(inst, 'monthNamesShort'); |
| 9146 | + var beforeShowDay = this._get(inst, 'beforeShowDay'); |
| 9147 | + var showOtherMonths = this._get(inst, 'showOtherMonths'); |
| 9148 | + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; |
| 9149 | + var endDate = inst.endDay ? this._daylightSavingAdjust( |
| 9150 | + new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate; |
| 9151 | + var defaultDate = this._getDefaultDate(inst); |
| 9152 | + var html = ''; |
| 9153 | + for (var row = 0; row < numMonths[0]; row++) { |
| 9154 | + var group = ''; |
| 9155 | + for (var col = 0; col < numMonths[1]; col++) { |
| 9156 | + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); |
| 9157 | + var cornerClass = ' ui-corner-all'; |
| 9158 | + var calender = ''; |
| 9159 | + if (isMultiMonth) { |
| 9160 | + calender += '<div class="ui-datepicker-group ui-datepicker-group-'; |
| 9161 | + switch (col) { |
| 9162 | + case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break; |
| 9163 | + case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break; |
| 9164 | + default: calender += 'middle'; cornerClass = ''; break; |
| 9165 | + } |
| 9166 | + calender += '">'; |
| 9167 | + } |
| 9168 | + calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + |
| 9169 | + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + |
| 9170 | + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + |
| 9171 | + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, |
| 9172 | + selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers |
| 9173 | + '</div><table class="ui-datepicker-calendar"><thead>' + |
| 9174 | + '<tr>'; |
| 9175 | + var thead = ''; |
| 9176 | + for (var dow = 0; dow < 7; dow++) { // days of the week |
| 9177 | + var day = (dow + firstDay) % 7; |
| 9178 | + thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + |
| 9179 | + '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>'; |
| 9180 | + } |
| 9181 | + calender += thead + '</tr></thead><tbody>'; |
| 9182 | + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); |
| 9183 | + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) |
| 9184 | + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); |
| 9185 | + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; |
| 9186 | + var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate |
| 9187 | + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); |
| 9188 | + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows |
| 9189 | + calender += '<tr>'; |
| 9190 | + var tbody = ''; |
| 9191 | + for (var dow = 0; dow < 7; dow++) { // create date picker days |
| 9192 | + var daySettings = (beforeShowDay ? |
| 9193 | + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); |
| 9194 | + var otherMonth = (printDate.getMonth() != drawMonth); |
| 9195 | + var unselectable = otherMonth || !daySettings[0] || |
| 9196 | + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); |
| 9197 | + tbody += '<td class="' + |
| 9198 | + ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends |
| 9199 | + (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months |
| 9200 | + ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key |
| 9201 | + (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ? |
| 9202 | + // or defaultDate is current printedDate and defaultDate is selectedDate |
| 9203 | + ' ' + this._dayOverClass : '') + // highlight selected day |
| 9204 | + (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days |
| 9205 | + (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates |
| 9206 | + (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range |
| 9207 | + ' ' + this._currentClass : '') + // highlight selected day |
| 9208 | + (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) |
| 9209 | + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title |
| 9210 | + (unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' + |
| 9211 | + inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions |
| 9212 | + (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months |
| 9213 | + (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + |
| 9214 | + (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') + |
| 9215 | + (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range |
| 9216 | + ' ui-state-active' : '') + // highlight selected day |
| 9217 | + '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month |
| 9218 | + printDate.setDate(printDate.getDate() + 1); |
| 9219 | + printDate = this._daylightSavingAdjust(printDate); |
| 9220 | + } |
| 9221 | + calender += tbody + '</tr>'; |
| 9222 | + } |
| 9223 | + drawMonth++; |
| 9224 | + if (drawMonth > 11) { |
| 9225 | + drawMonth = 0; |
| 9226 | + drawYear++; |
| 9227 | + } |
| 9228 | + calender += '</tbody></table>' + (isMultiMonth ? '</div>' + |
| 9229 | + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : ''); |
| 9230 | + group += calender; |
| 9231 | + } |
| 9232 | + html += group; |
| 9233 | + } |
| 9234 | + html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? |
| 9235 | + '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ''); |
| 9236 | + inst._keyEvent = false; |
| 9237 | + return html; |
| 9238 | + }, |
| 9239 | + |
| 9240 | + /* Generate the month and year header. */ |
| 9241 | + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, |
| 9242 | + selectedDate, secondary, monthNames, monthNamesShort) { |
| 9243 | + minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate); |
| 9244 | + var changeMonth = this._get(inst, 'changeMonth'); |
| 9245 | + var changeYear = this._get(inst, 'changeYear'); |
| 9246 | + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); |
| 9247 | + var html = '<div class="ui-datepicker-title">'; |
| 9248 | + var monthHtml = ''; |
| 9249 | + // month selection |
| 9250 | + if (secondary || !changeMonth) |
| 9251 | + monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> '; |
| 9252 | + else { |
| 9253 | + var inMinYear = (minDate && minDate.getFullYear() == drawYear); |
| 9254 | + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); |
| 9255 | + monthHtml += '<select class="ui-datepicker-month" ' + |
| 9256 | + 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' + |
| 9257 | + 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
| 9258 | + '>'; |
| 9259 | + for (var month = 0; month < 12; month++) { |
| 9260 | + if ((!inMinYear || month >= minDate.getMonth()) && |
| 9261 | + (!inMaxYear || month <= maxDate.getMonth())) |
| 9262 | + monthHtml += '<option value="' + month + '"' + |
| 9263 | + (month == drawMonth ? ' selected="selected"' : '') + |
| 9264 | + '>' + monthNamesShort[month] + '</option>'; |
| 9265 | + } |
| 9266 | + monthHtml += '</select>'; |
| 9267 | + } |
| 9268 | + if (!showMonthAfterYear) |
| 9269 | + html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? ' ' : ''); |
| 9270 | + // year selection |
| 9271 | + if (secondary || !changeYear) |
| 9272 | + html += '<span class="ui-datepicker-year">' + drawYear + '</span>'; |
| 9273 | + else { |
| 9274 | + // determine range of years to display |
| 9275 | + var years = this._get(inst, 'yearRange').split(':'); |
| 9276 | + var year = 0; |
| 9277 | + var endYear = 0; |
| 9278 | + if (years.length != 2) { |
| 9279 | + year = drawYear - 10; |
| 9280 | + endYear = drawYear + 10; |
| 9281 | + } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') { |
| 9282 | + year = drawYear + parseInt(years[0], 10); |
| 9283 | + endYear = drawYear + parseInt(years[1], 10); |
| 9284 | + } else { |
| 9285 | + year = parseInt(years[0], 10); |
| 9286 | + endYear = parseInt(years[1], 10); |
| 9287 | + } |
| 9288 | + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); |
| 9289 | + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); |
| 9290 | + html += '<select class="ui-datepicker-year" ' + |
| 9291 | + 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' + |
| 9292 | + 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
| 9293 | + '>'; |
| 9294 | + for (; year <= endYear; year++) { |
| 9295 | + html += '<option value="' + year + '"' + |
| 9296 | + (year == drawYear ? ' selected="selected"' : '') + |
| 9297 | + '>' + year + '</option>'; |
| 9298 | + } |
| 9299 | + html += '</select>'; |
| 9300 | + } |
| 9301 | + if (showMonthAfterYear) |
| 9302 | + html += (secondary || changeMonth || changeYear ? ' ' : '') + monthHtml; |
| 9303 | + html += '</div>'; // Close datepicker_header |
| 9304 | + return html; |
| 9305 | + }, |
| 9306 | + |
| 9307 | + /* Adjust one of the date sub-fields. */ |
| 9308 | + _adjustInstDate: function(inst, offset, period) { |
| 9309 | + var year = inst.drawYear + (period == 'Y' ? offset : 0); |
| 9310 | + var month = inst.drawMonth + (period == 'M' ? offset : 0); |
| 9311 | + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + |
| 9312 | + (period == 'D' ? offset : 0); |
| 9313 | + var date = this._daylightSavingAdjust(new Date(year, month, day)); |
| 9314 | + // ensure it is within the bounds set |
| 9315 | + var minDate = this._getMinMaxDate(inst, 'min', true); |
| 9316 | + var maxDate = this._getMinMaxDate(inst, 'max'); |
| 9317 | + date = (minDate && date < minDate ? minDate : date); |
| 9318 | + date = (maxDate && date > maxDate ? maxDate : date); |
| 9319 | + inst.selectedDay = date.getDate(); |
| 9320 | + inst.drawMonth = inst.selectedMonth = date.getMonth(); |
| 9321 | + inst.drawYear = inst.selectedYear = date.getFullYear(); |
| 9322 | + if (period == 'M' || period == 'Y') |
| 9323 | + this._notifyChange(inst); |
| 9324 | + }, |
| 9325 | + |
| 9326 | + /* Notify change of month/year. */ |
| 9327 | + _notifyChange: function(inst) { |
| 9328 | + var onChange = this._get(inst, 'onChangeMonthYear'); |
| 9329 | + if (onChange) |
| 9330 | + onChange.apply((inst.input ? inst.input[0] : null), |
| 9331 | + [inst.selectedYear, inst.selectedMonth + 1, inst]); |
| 9332 | + }, |
| 9333 | + |
| 9334 | + /* Determine the number of months to show. */ |
| 9335 | + _getNumberOfMonths: function(inst) { |
| 9336 | + var numMonths = this._get(inst, 'numberOfMonths'); |
| 9337 | + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); |
| 9338 | + }, |
| 9339 | + |
| 9340 | + /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */ |
| 9341 | + _getMinMaxDate: function(inst, minMax, checkRange) { |
| 9342 | + var date = this._determineDate(this._get(inst, minMax + 'Date'), null); |
| 9343 | + return (!checkRange || !inst.rangeStart ? date : |
| 9344 | + (!date || inst.rangeStart > date ? inst.rangeStart : date)); |
| 9345 | + }, |
| 9346 | + |
| 9347 | + /* Find the number of days in a given month. */ |
| 9348 | + _getDaysInMonth: function(year, month) { |
| 9349 | + return 32 - new Date(year, month, 32).getDate(); |
| 9350 | + }, |
| 9351 | + |
| 9352 | + /* Find the day of the week of the first of a month. */ |
| 9353 | + _getFirstDayOfMonth: function(year, month) { |
| 9354 | + return new Date(year, month, 1).getDay(); |
| 9355 | + }, |
| 9356 | + |
| 9357 | + /* Determines if we should allow a "next/prev" month display change. */ |
| 9358 | + _canAdjustMonth: function(inst, offset, curYear, curMonth) { |
| 9359 | + var numMonths = this._getNumberOfMonths(inst); |
| 9360 | + var date = this._daylightSavingAdjust(new Date( |
| 9361 | + curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1)); |
| 9362 | + if (offset < 0) |
| 9363 | + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); |
| 9364 | + return this._isInRange(inst, date); |
| 9365 | + }, |
| 9366 | + |
| 9367 | + /* Is the given date in the accepted range? */ |
| 9368 | + _isInRange: function(inst, date) { |
| 9369 | + // during range selection, use minimum of selected date and range start |
| 9370 | + var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust( |
| 9371 | + new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay))); |
| 9372 | + newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate); |
| 9373 | + var minDate = newMinDate || this._getMinMaxDate(inst, 'min'); |
| 9374 | + var maxDate = this._getMinMaxDate(inst, 'max'); |
| 9375 | + return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate)); |
| 9376 | + }, |
| 9377 | + |
| 9378 | + /* Provide the configuration settings for formatting/parsing. */ |
| 9379 | + _getFormatConfig: function(inst) { |
| 9380 | + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); |
| 9381 | + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : |
| 9382 | + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); |
| 9383 | + return {shortYearCutoff: shortYearCutoff, |
| 9384 | + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), |
| 9385 | + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; |
| 9386 | + }, |
| 9387 | + |
| 9388 | + /* Format the given date for display. */ |
| 9389 | + _formatDate: function(inst, day, month, year) { |
| 9390 | + if (!day) { |
| 9391 | + inst.currentDay = inst.selectedDay; |
| 9392 | + inst.currentMonth = inst.selectedMonth; |
| 9393 | + inst.currentYear = inst.selectedYear; |
| 9394 | + } |
| 9395 | + var date = (day ? (typeof day == 'object' ? day : |
| 9396 | + this._daylightSavingAdjust(new Date(year, month, day))) : |
| 9397 | + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); |
| 9398 | + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); |
| 9399 | + } |
| 9400 | +}); |
| 9401 | + |
| 9402 | +/* jQuery extend now ignores nulls! */ |
| 9403 | +function extendRemove(target, props) { |
| 9404 | + $.extend(target, props); |
| 9405 | + for (var name in props) |
| 9406 | + if (props[name] == null || props[name] == undefined) |
| 9407 | + target[name] = props[name]; |
| 9408 | + return target; |
| 9409 | +}; |
| 9410 | + |
| 9411 | +/* Determine whether an object is an array. */ |
| 9412 | +function isArray(a) { |
| 9413 | + return (a && (($.browser.safari && typeof a == 'object' && a.length) || |
| 9414 | + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); |
| 9415 | +}; |
| 9416 | + |
| 9417 | +/* Invoke the datepicker functionality. |
| 9418 | + @param options string - a command, optionally followed by additional parameters or |
| 9419 | + Object - settings for attaching new datepicker functionality |
| 9420 | + @return jQuery object */ |
| 9421 | +$.fn.datepicker = function(options){ |
| 9422 | + |
| 9423 | + /* Initialise the date picker. */ |
| 9424 | + if (!$.datepicker.initialized) { |
| 9425 | + $(document).mousedown($.datepicker._checkExternalClick). |
| 9426 | + find('body').append($.datepicker.dpDiv); |
| 9427 | + $.datepicker.initialized = true; |
| 9428 | + } |
| 9429 | + |
| 9430 | + var otherArgs = Array.prototype.slice.call(arguments, 1); |
| 9431 | + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) |
| 9432 | + return $.datepicker['_' + options + 'Datepicker']. |
| 9433 | + apply($.datepicker, [this[0]].concat(otherArgs)); |
| 9434 | + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') |
| 9435 | + return $.datepicker['_' + options + 'Datepicker']. |
| 9436 | + apply($.datepicker, [this[0]].concat(otherArgs)); |
| 9437 | + return this.each(function() { |
| 9438 | + typeof options == 'string' ? |
| 9439 | + $.datepicker['_' + options + 'Datepicker']. |
| 9440 | + apply($.datepicker, [this].concat(otherArgs)) : |
| 9441 | + $.datepicker._attachDatepicker(this, options); |
| 9442 | + }); |
| 9443 | +}; |
| 9444 | + |
| 9445 | +$.datepicker = new Datepicker(); // singleton instance |
| 9446 | +$.datepicker.initialized = false; |
| 9447 | +$.datepicker.uuid = new Date().getTime(); |
| 9448 | +$.datepicker.version = "1.7.2"; |
| 9449 | + |
| 9450 | +// Workaround for #4055 |
| 9451 | +// Add another global to avoid noConflict issues with inline event handlers |
| 9452 | +window.DP_jQuery = $; |
| 9453 | + |
| 9454 | +})(jQuery); |
| 9455 | +/* JavaScript for MediaWIki JS2 */ |
| 9456 | + |
| 9457 | +/** |
| 9458 | + * This is designed to be directly compatible with (and is essentially taken |
| 9459 | + * directly from) the mv_embed code for bringing internationalized messages into |
| 9460 | + * the JavaScript space. As such, if we get to the point of merging that stuff |
| 9461 | + * into the main branch this code will be uneeded and probably cause issues. |
| 9462 | + */ |
| 9463 | +// Creates global message object if not already in existence |
| 9464 | +if ( !gMsg ) var gMsg = {}; |
| 9465 | +/** |
| 9466 | + * Caches a list of messages for later retrieval |
| 9467 | + * @param {Object} msgSet Hash of key:value pairs of messages to cache |
| 9468 | + */ |
| 9469 | +function loadGM( msgSet ){ |
| 9470 | + for ( var i in msgSet ){ |
| 9471 | + gMsg[ i ] = msgSet[i]; |
| 9472 | + } |
| 9473 | +} |
| 9474 | +/** |
| 9475 | + * Retieves a message from the global message cache, performing on-the-fly |
| 9476 | + * replacements using MediaWiki message syntax ($1, $2, etc.) |
| 9477 | + * @param {String} key Name of message as it is in MediaWiki |
| 9478 | + * @param {Array} args Array of replacement arguments |
| 9479 | + */ |
| 9480 | +function gM( key, args ) { |
| 9481 | + var ms = ''; |
| 9482 | + if ( key in gMsg ) { |
| 9483 | + ms = gMsg[ key ]; |
| 9484 | + if ( typeof args == 'object' || typeof args == 'array' ) { |
| 9485 | + for ( var v in args ){ |
| 9486 | + var rep = '\$'+ ( parseInt(v) + 1 ); |
| 9487 | + ms = ms.replace( rep, args[v]); |
| 9488 | + } |
| 9489 | + } else if ( typeof args =='string' || typeof args =='number' ) { |
| 9490 | + ms = ms.replace( /\$1/, args ); |
| 9491 | + } |
| 9492 | + return ms; |
| 9493 | + } else { |
| 9494 | + return '[' + key + ']'; |
| 9495 | + } |
| 9496 | +} |
| 9497 | +/** |
| 9498 | + * Mimics the no-conflict method used by the js2 stuff |
| 9499 | + */ |
| 9500 | +$j = jQuery.noConflict(); |
| 9501 | +/** |
| 9502 | + * Provides js2 compatible onload hook |
| 9503 | + * @param func Function to call when ready |
| 9504 | + */ |
| 9505 | +function js2AddOnloadHook( func ) { |
| 9506 | + $j(document).ready( func ); |
| 9507 | +} |
| 9508 | + |
| 9509 | +// Define a dummy mvJsLoader.doLoad() function |
| 9510 | +mvJsLoader = { doLoad: function( deps, callback ) { callback(); } }; |
Property changes on: trunk/extensions/Translate/js/js2stopgap.js |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 9511 | + native |
Index: trunk/extensions/Translate/js/base/ui.dialog.css |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +/* Dialog |
| 3 | +----------------------------------*/ |
| 4 | +.ui-dialog { position: relative; padding: .2em; width: 300px; } |
| 5 | +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } |
| 6 | +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } |
| 7 | +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } |
| 8 | +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } |
| 9 | +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } |
| 10 | +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } |
| 11 | +.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; } |
| 12 | +.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; } |
| 13 | +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } |
| 14 | +.ui-draggable .ui-dialog-titlebar { cursor: move; } |
Property changes on: trunk/extensions/Translate/js/base/ui.dialog.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 15 | + native |
Index: trunk/extensions/Translate/js/base/ui.resizable.css |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +/* Resizable |
| 3 | +----------------------------------*/ |
| 4 | +.ui-resizable { position: relative;} |
| 5 | +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} |
| 6 | +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } |
| 7 | +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } |
| 8 | +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } |
| 9 | +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } |
| 10 | +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } |
| 11 | +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } |
| 12 | +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } |
| 13 | +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } |
| 14 | +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.resizable.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 15 | + native |
Index: trunk/extensions/Translate/js/base/ui.accordion.css |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +/* Accordion |
| 3 | +----------------------------------*/ |
| 4 | +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } |
| 5 | +.ui-accordion .ui-accordion-li-fix { display: inline; } |
| 6 | +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } |
| 7 | +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } |
| 8 | +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } |
| 9 | +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } |
| 10 | +.ui-accordion .ui-accordion-content-active { display: block; } |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.accordion.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 11 | + native |
Index: trunk/extensions/Translate/js/base/images/ui-bg_inset-soft_95_fef1ec_1x100.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_inset-soft_95_fef1ec_1x100.png |
___________________________________________________________________ |
Name: svn:mime-type |
2 | 12 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-icons_2e83ff_256x240.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-icons_2e83ff_256x240.png |
___________________________________________________________________ |
Name: svn:mime-type |
3 | 13 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-icons_888888_256x240.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-icons_888888_256x240.png |
___________________________________________________________________ |
Name: svn:mime-type |
4 | 14 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_glass_55_fbf9ee_1x400.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_glass_55_fbf9ee_1x400.png |
___________________________________________________________________ |
Name: svn:mime-type |
5 | 15 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_dadada_1x400.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_dadada_1x400.png |
___________________________________________________________________ |
Name: svn:mime-type |
6 | 16 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_e6e6e6_1x400.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_e6e6e6_1x400.png |
___________________________________________________________________ |
Name: svn:mime-type |
7 | 17 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_glass_65_ffffff_1x400.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_glass_65_ffffff_1x400.png |
___________________________________________________________________ |
Name: svn:mime-type |
8 | 18 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_ffffff_1x400.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_glass_75_ffffff_1x400.png |
___________________________________________________________________ |
Name: svn:mime-type |
9 | 19 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_diagonals-thick_20_666666_40x40.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_diagonals-thick_20_666666_40x40.png |
___________________________________________________________________ |
Name: svn:mime-type |
10 | 20 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png |
___________________________________________________________________ |
Name: svn:mime-type |
11 | 21 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-icons_cd0a0a_256x240.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-icons_cd0a0a_256x240.png |
___________________________________________________________________ |
Name: svn:mime-type |
12 | 22 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-bg_flat_0_aaaaaa_40x100.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-bg_flat_0_aaaaaa_40x100.png |
___________________________________________________________________ |
Name: svn:mime-type |
13 | 23 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-icons_454545_256x240.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-icons_454545_256x240.png |
___________________________________________________________________ |
Name: svn:mime-type |
14 | 24 | + image/png |
Index: trunk/extensions/Translate/js/base/images/ui-icons_222222_256x240.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Translate/js/base/images/ui-icons_222222_256x240.png |
___________________________________________________________________ |
Name: svn:mime-type |
15 | 25 | + image/png |
Index: trunk/extensions/Translate/js/base/ui.slider.css |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +/* Slider |
| 3 | +----------------------------------*/ |
| 4 | +.ui-slider { position: relative; text-align: left; } |
| 5 | +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } |
| 6 | +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } |
| 7 | + |
| 8 | +.ui-slider-horizontal { height: .8em; } |
| 9 | +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } |
| 10 | +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } |
| 11 | +.ui-slider-horizontal .ui-slider-range-min { left: 0; } |
| 12 | +.ui-slider-horizontal .ui-slider-range-max { right: 0; } |
| 13 | + |
| 14 | +.ui-slider-vertical { width: .8em; height: 100px; } |
| 15 | +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } |
| 16 | +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } |
| 17 | +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } |
| 18 | +.ui-slider-vertical .ui-slider-range-max { top: 0; } |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.slider.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 19 | + native |
Index: trunk/extensions/Translate/js/base/ui.theme.css |
— | — | @@ -0,0 +1,243 @@ |
| 2 | +/* |
| 3 | +* jQuery UI CSS Framework |
| 4 | +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
| 5 | +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. |
| 6 | +* To view and modify this theme, visit http://jqueryui.com/themeroller/ |
| 7 | +*/ |
| 8 | + |
| 9 | + |
| 10 | +/* Component containers |
| 11 | +----------------------------------*/ |
| 12 | +.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } |
| 13 | +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } |
| 14 | +.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_glass_75_ffffff_1x400.png)/*{bgImgUrlContent}*/ 0/*{bgContentXPos}*/ 0/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } |
| 15 | +.ui-widget-content a { color: #222222/*{fcContent}*/; } |
| 16 | +.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 0/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } |
| 17 | +.ui-widget-header a { color: #222222/*{fcHeader}*/; } |
| 18 | + |
| 19 | +/* Interaction states |
| 20 | +----------------------------------*/ |
| 21 | +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 0/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; outline: none; } |
| 22 | +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; outline: none; } |
| 23 | +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 0/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; outline: none; } |
| 24 | +.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; outline: none; } |
| 25 | +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 0/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; } |
| 26 | +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; } |
| 27 | + |
| 28 | +/* Interaction Cues |
| 29 | +----------------------------------*/ |
| 30 | +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 0/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } |
| 31 | +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } |
| 32 | +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_inset-soft_95_fef1ec_1x100.png)/*{bgImgUrlError}*/ 0/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } |
| 33 | +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #363636/*{fcError}*/; } |
| 34 | +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } |
| 35 | +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } |
| 36 | +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } |
| 37 | +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } |
| 38 | + |
| 39 | +/* Icons |
| 40 | +----------------------------------*/ |
| 41 | + |
| 42 | +/* states and images */ |
| 43 | +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } |
| 44 | +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } |
| 45 | +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } |
| 46 | +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } |
| 47 | +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } |
| 48 | +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } |
| 49 | +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } |
| 50 | +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } |
| 51 | + |
| 52 | +/* positioning */ |
| 53 | +.ui-icon-carat-1-n { background-position: 0 0; } |
| 54 | +.ui-icon-carat-1-ne { background-position: -16px 0; } |
| 55 | +.ui-icon-carat-1-e { background-position: -32px 0; } |
| 56 | +.ui-icon-carat-1-se { background-position: -48px 0; } |
| 57 | +.ui-icon-carat-1-s { background-position: -64px 0; } |
| 58 | +.ui-icon-carat-1-sw { background-position: -80px 0; } |
| 59 | +.ui-icon-carat-1-w { background-position: -96px 0; } |
| 60 | +.ui-icon-carat-1-nw { background-position: -112px 0; } |
| 61 | +.ui-icon-carat-2-n-s { background-position: -128px 0; } |
| 62 | +.ui-icon-carat-2-e-w { background-position: -144px 0; } |
| 63 | +.ui-icon-triangle-1-n { background-position: 0 -16px; } |
| 64 | +.ui-icon-triangle-1-ne { background-position: -16px -16px; } |
| 65 | +.ui-icon-triangle-1-e { background-position: -32px -16px; } |
| 66 | +.ui-icon-triangle-1-se { background-position: -48px -16px; } |
| 67 | +.ui-icon-triangle-1-s { background-position: -64px -16px; } |
| 68 | +.ui-icon-triangle-1-sw { background-position: -80px -16px; } |
| 69 | +.ui-icon-triangle-1-w { background-position: -96px -16px; } |
| 70 | +.ui-icon-triangle-1-nw { background-position: -112px -16px; } |
| 71 | +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } |
| 72 | +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } |
| 73 | +.ui-icon-arrow-1-n { background-position: 0 -32px; } |
| 74 | +.ui-icon-arrow-1-ne { background-position: -16px -32px; } |
| 75 | +.ui-icon-arrow-1-e { background-position: -32px -32px; } |
| 76 | +.ui-icon-arrow-1-se { background-position: -48px -32px; } |
| 77 | +.ui-icon-arrow-1-s { background-position: -64px -32px; } |
| 78 | +.ui-icon-arrow-1-sw { background-position: -80px -32px; } |
| 79 | +.ui-icon-arrow-1-w { background-position: -96px -32px; } |
| 80 | +.ui-icon-arrow-1-nw { background-position: -112px -32px; } |
| 81 | +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } |
| 82 | +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } |
| 83 | +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } |
| 84 | +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } |
| 85 | +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } |
| 86 | +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } |
| 87 | +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } |
| 88 | +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } |
| 89 | +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } |
| 90 | +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } |
| 91 | +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } |
| 92 | +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } |
| 93 | +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } |
| 94 | +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } |
| 95 | +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } |
| 96 | +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } |
| 97 | +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } |
| 98 | +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } |
| 99 | +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } |
| 100 | +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } |
| 101 | +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } |
| 102 | +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } |
| 103 | +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } |
| 104 | +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } |
| 105 | +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } |
| 106 | +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } |
| 107 | +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } |
| 108 | +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } |
| 109 | +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } |
| 110 | +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } |
| 111 | +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } |
| 112 | +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } |
| 113 | +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } |
| 114 | +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } |
| 115 | +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } |
| 116 | +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } |
| 117 | +.ui-icon-arrow-4 { background-position: 0 -80px; } |
| 118 | +.ui-icon-arrow-4-diag { background-position: -16px -80px; } |
| 119 | +.ui-icon-extlink { background-position: -32px -80px; } |
| 120 | +.ui-icon-newwin { background-position: -48px -80px; } |
| 121 | +.ui-icon-refresh { background-position: -64px -80px; } |
| 122 | +.ui-icon-shuffle { background-position: -80px -80px; } |
| 123 | +.ui-icon-transfer-e-w { background-position: -96px -80px; } |
| 124 | +.ui-icon-transferthick-e-w { background-position: -112px -80px; } |
| 125 | +.ui-icon-folder-collapsed { background-position: 0 -96px; } |
| 126 | +.ui-icon-folder-open { background-position: -16px -96px; } |
| 127 | +.ui-icon-document { background-position: -32px -96px; } |
| 128 | +.ui-icon-document-b { background-position: -48px -96px; } |
| 129 | +.ui-icon-note { background-position: -64px -96px; } |
| 130 | +.ui-icon-mail-closed { background-position: -80px -96px; } |
| 131 | +.ui-icon-mail-open { background-position: -96px -96px; } |
| 132 | +.ui-icon-suitcase { background-position: -112px -96px; } |
| 133 | +.ui-icon-comment { background-position: -128px -96px; } |
| 134 | +.ui-icon-person { background-position: -144px -96px; } |
| 135 | +.ui-icon-print { background-position: -160px -96px; } |
| 136 | +.ui-icon-trash { background-position: -176px -96px; } |
| 137 | +.ui-icon-locked { background-position: -192px -96px; } |
| 138 | +.ui-icon-unlocked { background-position: -208px -96px; } |
| 139 | +.ui-icon-bookmark { background-position: -224px -96px; } |
| 140 | +.ui-icon-tag { background-position: -240px -96px; } |
| 141 | +.ui-icon-home { background-position: 0 -112px; } |
| 142 | +.ui-icon-flag { background-position: -16px -112px; } |
| 143 | +.ui-icon-calendar { background-position: -32px -112px; } |
| 144 | +.ui-icon-cart { background-position: -48px -112px; } |
| 145 | +.ui-icon-pencil { background-position: -64px -112px; } |
| 146 | +.ui-icon-clock { background-position: -80px -112px; } |
| 147 | +.ui-icon-disk { background-position: -96px -112px; } |
| 148 | +.ui-icon-calculator { background-position: -112px -112px; } |
| 149 | +.ui-icon-zoomin { background-position: -128px -112px; } |
| 150 | +.ui-icon-zoomout { background-position: -144px -112px; } |
| 151 | +.ui-icon-search { background-position: -160px -112px; } |
| 152 | +.ui-icon-wrench { background-position: -176px -112px; } |
| 153 | +.ui-icon-gear { background-position: -192px -112px; } |
| 154 | +.ui-icon-heart { background-position: -208px -112px; } |
| 155 | +.ui-icon-star { background-position: -224px -112px; } |
| 156 | +.ui-icon-link { background-position: -240px -112px; } |
| 157 | +.ui-icon-cancel { background-position: 0 -128px; } |
| 158 | +.ui-icon-plus { background-position: -16px -128px; } |
| 159 | +.ui-icon-plusthick { background-position: -32px -128px; } |
| 160 | +.ui-icon-minus { background-position: -48px -128px; } |
| 161 | +.ui-icon-minusthick { background-position: -64px -128px; } |
| 162 | +.ui-icon-close { background-position: -80px -128px; } |
| 163 | +.ui-icon-closethick { background-position: -96px -128px; } |
| 164 | +.ui-icon-key { background-position: -112px -128px; } |
| 165 | +.ui-icon-lightbulb { background-position: -128px -128px; } |
| 166 | +.ui-icon-scissors { background-position: -144px -128px; } |
| 167 | +.ui-icon-clipboard { background-position: -160px -128px; } |
| 168 | +.ui-icon-copy { background-position: -176px -128px; } |
| 169 | +.ui-icon-contact { background-position: -192px -128px; } |
| 170 | +.ui-icon-image { background-position: -208px -128px; } |
| 171 | +.ui-icon-video { background-position: -224px -128px; } |
| 172 | +.ui-icon-script { background-position: -240px -128px; } |
| 173 | +.ui-icon-alert { background-position: 0 -144px; } |
| 174 | +.ui-icon-info { background-position: -16px -144px; } |
| 175 | +.ui-icon-notice { background-position: -32px -144px; } |
| 176 | +.ui-icon-help { background-position: -48px -144px; } |
| 177 | +.ui-icon-check { background-position: -64px -144px; } |
| 178 | +.ui-icon-bullet { background-position: -80px -144px; } |
| 179 | +.ui-icon-radio-off { background-position: -96px -144px; } |
| 180 | +.ui-icon-radio-on { background-position: -112px -144px; } |
| 181 | +.ui-icon-pin-w { background-position: -128px -144px; } |
| 182 | +.ui-icon-pin-s { background-position: -144px -144px; } |
| 183 | +.ui-icon-play { background-position: 0 -160px; } |
| 184 | +.ui-icon-pause { background-position: -16px -160px; } |
| 185 | +.ui-icon-seek-next { background-position: -32px -160px; } |
| 186 | +.ui-icon-seek-prev { background-position: -48px -160px; } |
| 187 | +.ui-icon-seek-end { background-position: -64px -160px; } |
| 188 | +.ui-icon-seek-first { background-position: -80px -160px; } |
| 189 | +.ui-icon-stop { background-position: -96px -160px; } |
| 190 | +.ui-icon-eject { background-position: -112px -160px; } |
| 191 | +.ui-icon-volume-off { background-position: -128px -160px; } |
| 192 | +.ui-icon-volume-on { background-position: -144px -160px; } |
| 193 | +.ui-icon-power { background-position: 0 -176px; } |
| 194 | +.ui-icon-signal-diag { background-position: -16px -176px; } |
| 195 | +.ui-icon-signal { background-position: -32px -176px; } |
| 196 | +.ui-icon-battery-0 { background-position: -48px -176px; } |
| 197 | +.ui-icon-battery-1 { background-position: -64px -176px; } |
| 198 | +.ui-icon-battery-2 { background-position: -80px -176px; } |
| 199 | +.ui-icon-battery-3 { background-position: -96px -176px; } |
| 200 | +.ui-icon-circle-plus { background-position: 0 -192px; } |
| 201 | +.ui-icon-circle-minus { background-position: -16px -192px; } |
| 202 | +.ui-icon-circle-close { background-position: -32px -192px; } |
| 203 | +.ui-icon-circle-triangle-e { background-position: -48px -192px; } |
| 204 | +.ui-icon-circle-triangle-s { background-position: -64px -192px; } |
| 205 | +.ui-icon-circle-triangle-w { background-position: -80px -192px; } |
| 206 | +.ui-icon-circle-triangle-n { background-position: -96px -192px; } |
| 207 | +.ui-icon-circle-arrow-e { background-position: -112px -192px; } |
| 208 | +.ui-icon-circle-arrow-s { background-position: -128px -192px; } |
| 209 | +.ui-icon-circle-arrow-w { background-position: -144px -192px; } |
| 210 | +.ui-icon-circle-arrow-n { background-position: -160px -192px; } |
| 211 | +.ui-icon-circle-zoomin { background-position: -176px -192px; } |
| 212 | +.ui-icon-circle-zoomout { background-position: -192px -192px; } |
| 213 | +.ui-icon-circle-check { background-position: -208px -192px; } |
| 214 | +.ui-icon-circlesmall-plus { background-position: 0 -208px; } |
| 215 | +.ui-icon-circlesmall-minus { background-position: -16px -208px; } |
| 216 | +.ui-icon-circlesmall-close { background-position: -32px -208px; } |
| 217 | +.ui-icon-squaresmall-plus { background-position: -48px -208px; } |
| 218 | +.ui-icon-squaresmall-minus { background-position: -64px -208px; } |
| 219 | +.ui-icon-squaresmall-close { background-position: -80px -208px; } |
| 220 | +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } |
| 221 | +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } |
| 222 | +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } |
| 223 | +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } |
| 224 | +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } |
| 225 | +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } |
| 226 | + |
| 227 | + |
| 228 | +/* Misc visuals |
| 229 | +----------------------------------*/ |
| 230 | + |
| 231 | +/* Corner radius */ |
| 232 | +.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; } |
| 233 | +.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; } |
| 234 | +.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; } |
| 235 | +.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } |
| 236 | +.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; } |
| 237 | +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } |
| 238 | +.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } |
| 239 | +.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; } |
| 240 | +.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; } |
| 241 | + |
| 242 | +/* Overlays */ |
| 243 | +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ none/*{bgImgUrlOverlay}*/ 0/*{bgOverlayXPos}*/ 0/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } |
| 244 | +.ui-widget-shadow { margin: -4px/*{offsetTopShadow}*/ 0 0 -4px/*{offsetLeftShadow}*/; padding: 4px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ none/*{bgImgUrlShadow}*/ 0/*{bgShadowXPos}*/ 0/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .35;filter:Alpha(Opacity=35)/*{opacityShadow}*/; -moz-border-radius: 4px/*{cornerRadiusShadow}*/; -webkit-border-radius: 4px/*{cornerRadiusShadow}*/; } |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.theme.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 245 | + native |
Index: trunk/extensions/Translate/js/base/ui.all.css |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +@import "ui.base.css"; |
| 3 | +@import "ui.theme.css"; |
Property changes on: trunk/extensions/Translate/js/base/ui.all.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 4 | + native |
Index: trunk/extensions/Translate/js/base/ui.core.css |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +/* |
| 3 | +* jQuery UI CSS Framework |
| 4 | +* Copyright (c) 2009 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%; } |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.core.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 39 | + native |
Index: trunk/extensions/Translate/js/base/jquery-ui-1.7.1.custom.css |
— | — | @@ -0,0 +1,287 @@ |
| 2 | +
|
| 3 | +/*
|
| 4 | +* jQuery UI CSS Framework
|
| 5 | +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
| 6 | +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
| 7 | +* To view and modify this theme, visit http://jqueryui.com/themeroller/
|
| 8 | +*/
|
| 9 | +
|
| 10 | +/*** Begin CORE ***/
|
| 11 | +
|
| 12 | +/* Layout helpers
|
| 13 | +----------------------------------*/
|
| 14 | +.ui-helper-hidden { display: none; }
|
| 15 | +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
|
| 16 | +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
| 17 | +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
| 18 | +.ui-helper-clearfix { display: inline-block; }
|
| 19 | +/* required comment for clearfix to work in Opera \*/
|
| 20 | +* html .ui-helper-clearfix { height:1%; }
|
| 21 | +.ui-helper-clearfix { display:block; }
|
| 22 | +/* end clearfix */
|
| 23 | +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }*/
|
| 24 | +
|
| 25 | +
|
| 26 | +/* Interaction Cues
|
| 27 | +----------------------------------*/
|
| 28 | +.ui-state-disabled { cursor: default !important; }
|
| 29 | +
|
| 30 | +
|
| 31 | +/* Icons
|
| 32 | +----------------------------------*/
|
| 33 | +
|
| 34 | +/* states and images */
|
| 35 | +.ui-icon { display: block; text-indents: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
| 36 | +
|
| 37 | +
|
| 38 | +/* Misc visuals
|
| 39 | +----------------------------------*/
|
| 40 | +
|
| 41 | +/* Overlays */
|
| 42 | +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
| 43 | +
|
| 44 | +/*** End Core ***/
|
| 45 | +
|
| 46 | +
|
| 47 | +/*** Begin THEME ***/
|
| 48 | +
|
| 49 | +/* Component containers
|
| 50 | +----------------------------------*/
|
| 51 | +.ui-widget { font-family: Arial,sans-serif/*{ffDefault}*/; font-size: 11px/*{fsDefault}*/; }
|
| 52 | +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,sans-serif/*{ffDefault}*/; font-size: 11px; }
|
| 53 | +.ui-widget-content { border: none/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png) 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*//*{bgContentRepeat}*/; color: #A9A9A9/*{fcContent}*/; }
|
| 54 | +.ui-widget-content a { color: #A9A9A9/*{fcContent}*/; }
|
| 55 | +.ui-widget-header { border: none/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*//*{bgHeaderRepeat}*/; color: #565656/*{fcHeader}*/; font-weight: bold; }
|
| 56 | +.ui-widget-header a { color: #000/*{fcHeader}*/; }
|
| 57 | +
|
| 58 | +
|
| 59 | +
|
| 60 | +/* Interaction states
|
| 61 | +----------------------------------*/
|
| 62 | +.ui-state-default, .ui-widget-content .ui-state-default { border: none/*{borderColorDefault}*/; background: none/*{bgColorDefault}*/ /*{bgDefaultXPos}*/ /*{bgDefaultYPos}*/ /*{bgDefaultRepeat}*//*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #333/*{fcDefault}*/; outline: none; }
|
| 63 | +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #000/*{fcDefault}*/; text-decoration: none; outline: none; }
|
| 64 | +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: none/*{borderColorHover}*/; background: none/*{bgColorHover}*/ none /*{bgHoverXPos}*/ /*{bgHoverYPos}*/ /*{bgHoverRepeat}*//*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #222/*{fcHover}*/; outline: none; }
|
| 65 | +.ui-state-hover a, .ui-state-hover a:hover { color: #000/*{fcHover}*/; text-decoration: none; outline: none; }
|
| 66 | +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #ccc/*{borderColorActive}*/; background: none/*{bgColorActive}*/ /*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*//*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; }
|
| 67 | +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; }
|
| 68 | +
|
| 69 | +/* Interaction Cues
|
| 70 | +----------------------------------*/
|
| 71 | +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*//*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
|
| 72 | +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
|
| 73 | +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png) 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*//*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
|
| 74 | +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
|
| 75 | +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
|
| 76 | +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
| 77 | +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
|
| 78 | +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
| 79 | +
|
| 80 | +/* Icons
|
| 81 | +----------------------------------*/
|
| 82 | +
|
| 83 | +/* states and images */
|
| 84 | +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
| 85 | +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
| 86 | +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
|
| 87 | +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
|
| 88 | +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
|
| 89 | +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
|
| 90 | +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
|
| 91 | +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
|
| 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-first { background-position: -80px -160px; }
|
| 230 | +.ui-icon-stop { background-position: -96px -160px; }
|
| 231 | +.ui-icon-eject { background-position: -112px -160px; }
|
| 232 | +.ui-icon-volume-off { background-position: -128px -160px; }
|
| 233 | +.ui-icon-volume-on { background-position: -144px -160px; }
|
| 234 | +.ui-icon-power { background-position: 0 -176px; }
|
| 235 | +.ui-icon-signal-diag { background-position: -16px -176px; }
|
| 236 | +.ui-icon-signal { background-position: -32px -176px; }
|
| 237 | +.ui-icon-battery-0 { background-position: -48px -176px; }
|
| 238 | +.ui-icon-battery-1 { background-position: -64px -176px; }
|
| 239 | +.ui-icon-battery-2 { background-position: -80px -176px; }
|
| 240 | +.ui-icon-battery-3 { background-position: -96px -176px; }
|
| 241 | +.ui-icon-circle-plus { background-position: 0 -192px; }
|
| 242 | +.ui-icon-circle-minus { background-position: -16px -192px; }
|
| 243 | +.ui-icon-circle-close { background-position: -32px -192px; }
|
| 244 | +.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
| 245 | +.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
| 246 | +.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
| 247 | +.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
| 248 | +.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
| 249 | +.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
| 250 | +.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
| 251 | +.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
| 252 | +.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
| 253 | +.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
| 254 | +.ui-icon-circle-check { background-position: -208px -192px; }
|
| 255 | +.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
| 256 | +.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
| 257 | +.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
| 258 | +.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
| 259 | +.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
| 260 | +.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
| 261 | +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
| 262 | +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
| 263 | +.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
| 264 | +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
| 265 | +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
| 266 | +.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
| 267 | +
|
| 268 | +
|
| 269 | +/* Misc visuals
|
| 270 | +----------------------------------*/
|
| 271 | +
|
| 272 | +/* Corner radius */
|
| 273 | +.ui-corner-tl { -moz-border-radius-topleft: 5px/*{cornerRadius}*/; -webkit-border-top-left-radius: 5px/*{cornerRadius}*/; }
|
| 274 | +.ui-corner-tr { -moz-border-radius-topright: 5px/*{cornerRadius}*/; -webkit-border-top-right-radius: 5px/*{cornerRadius}*/; }
|
| 275 | +.ui-corner-bl { -moz-border-radius-bottomleft: 5px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 5px/*{cornerRadius}*/; }
|
| 276 | +.ui-corner-br { -moz-border-radius-bottomright: 5px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 5px/*{cornerRadius}*/; }
|
| 277 | +.ui-corner-top { -moz-border-radius-topleft: 5px/*{cornerRadius}*/; -webkit-border-top-left-radius: 5px/*{cornerRadius}*/; -moz-border-radius-topright: 5px/*{cornerRadius}*/; -webkit-border-top-right-radius: 5px/*{cornerRadius}*/; }
|
| 278 | +.ui-corner-bottom { -moz-border-radius-bottomleft: 5px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 5px/*{cornerRadius}*/; -moz-border-radius-bottomright: 5px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 5px/*{cornerRadius}*/; }
|
| 279 | +.ui-corner-right { -moz-border-radius-topright: 5px/*{cornerRadius}*/; -webkit-border-top-right-radius: 5px/*{cornerRadius}*/; -moz-border-radius-bottomright: 5px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 5px/*{cornerRadius}*/; }
|
| 280 | +.ui-corner-left { -moz-border-radius-topleft: 5px/*{cornerRadius}*/; -webkit-border-top-left-radius: 5px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 5px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 5px/*{cornerRadius}*/; }
|
| 281 | +.ui-corner-all { -moz-border-radius: 5px/*{cornerRadius}*/; -webkit-border-radius: 5px/*{cornerRadius}*/; }
|
| 282 | +
|
| 283 | +/* Overlays */
|
| 284 | +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*//*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
|
| 285 | +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*//*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; }
|
| 286 | +
|
| 287 | +
|
| 288 | +
|
Index: trunk/extensions/Translate/js/base/ui.progressbar.css |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +/* Progressbar |
| 3 | +----------------------------------*/ |
| 4 | +.ui-progressbar { height:2em; text-align: left; } |
| 5 | +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.progressbar.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 6 | + native |
Index: trunk/extensions/Translate/js/base/ui.tabs.css |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +/* Tabs |
| 3 | +----------------------------------*/ |
| 4 | +.ui-tabs { padding: .2em; zoom: 1; } |
| 5 | +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } |
| 6 | +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } |
| 7 | +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } |
| 8 | +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } |
| 9 | +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } |
| 10 | +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ |
| 11 | +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } |
| 12 | +.ui-tabs .ui-tabs-hide { display: none !important; } |
Property changes on: trunk/extensions/Translate/js/base/ui.tabs.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 13 | + native |
Index: trunk/extensions/Translate/js/base/ui.base.css |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +@import url("ui.core.css"); |
| 3 | +@import url("ui.resizable.css"); |
| 4 | +@import url("ui.accordion.css"); |
| 5 | +@import url("ui.dialog.css"); |
| 6 | +@import url("ui.slider.css"); |
| 7 | +@import url("ui.tabs.css"); |
| 8 | +@import url("ui.datepicker.css"); |
| 9 | +@import url("ui.progressbar.css"); |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.base.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 10 | + native |
Index: trunk/extensions/Translate/js/base/ui.datepicker.css |
— | — | @@ -0,0 +1,62 @@ |
| 2 | +/* Datepicker |
| 3 | +----------------------------------*/ |
| 4 | +.ui-datepicker { width: 17em; padding: .2em .2em 0; } |
| 5 | +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } |
| 6 | +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } |
| 7 | +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } |
| 8 | +.ui-datepicker .ui-datepicker-prev { left:2px; } |
| 9 | +.ui-datepicker .ui-datepicker-next { right:2px; } |
| 10 | +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } |
| 11 | +.ui-datepicker .ui-datepicker-next-hover { right:1px; } |
| 12 | +.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; } |
| 13 | +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } |
| 14 | +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } |
| 15 | +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} |
| 16 | +.ui-datepicker select.ui-datepicker-month, |
| 17 | +.ui-datepicker select.ui-datepicker-year { width: 49%;} |
| 18 | +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } |
| 19 | +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } |
| 20 | +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } |
| 21 | +.ui-datepicker td { border: 0; padding: 1px; } |
| 22 | +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } |
| 23 | +.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; } |
| 24 | +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } |
| 25 | +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } |
| 26 | + |
| 27 | +/* with multiple calendars */ |
| 28 | +.ui-datepicker.ui-datepicker-multi { width:auto; } |
| 29 | +.ui-datepicker-multi .ui-datepicker-group { float:left; } |
| 30 | +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } |
| 31 | +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } |
| 32 | +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } |
| 33 | +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } |
| 34 | +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } |
| 35 | +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } |
| 36 | +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } |
| 37 | +.ui-datepicker-row-break { clear:both; width:100%; } |
| 38 | + |
| 39 | +/* RTL support */ |
| 40 | +.ui-datepicker-rtl { direction: rtl; } |
| 41 | +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } |
| 42 | +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } |
| 43 | +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } |
| 44 | +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } |
| 45 | +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } |
| 46 | +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } |
| 47 | +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } |
| 48 | +.ui-datepicker-rtl .ui-datepicker-group { float:right; } |
| 49 | +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| 50 | +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } |
| 51 | + |
| 52 | +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ |
| 53 | +.ui-datepicker-cover { |
| 54 | + display: none; /*sorry for IE5*/ |
| 55 | + display/**/: block; /*sorry for IE5*/ |
| 56 | + position: absolute; /*must have*/ |
| 57 | + z-index: -1; /*must have*/ |
| 58 | + filter: mask(); /*must have*/ |
| 59 | + top: -4px; /*must have*/ |
| 60 | + left: -4px; /*must have*/ |
| 61 | + width: 200px; /*must have*/ |
| 62 | + height: 200px; /*must have*/ |
| 63 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/js/base/ui.datepicker.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 64 | + native |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -68,10 +68,6 @@ |
69 | 69 | $wgHooks['SpecialRecentChangesPanel'][] = 'TranslateRcFilter::translationFilterForm'; |
70 | 70 | $wgHooks['SkinTemplateToolboxEnd'][] = 'TranslateToolbox::toolboxAllTranslations'; |
71 | 71 | |
72 | | -$wgJSAutoloadClasses['TranslateImport'] = "extensions/Translate/js/import.js"; |
73 | | -$wgJSAutoloadClasses['JsSelectToInput'] = "extensions/Translate/utils/JsSelectToInput.js"; |
74 | | -$wgJSAutoloadClasses['JsEdit'] = "extensions/Translate/js/quickedit.js"; |
75 | | -$wgJSAutoloadClasses['j.form'] = "extensions/Translate/js/jquery.form.js"; |
76 | 72 | |
77 | 73 | |
78 | 74 | $wgEnablePageTranslation = false; |
Index: trunk/extensions/Translate/utils/MessageTable.php |
— | — | @@ -48,19 +48,17 @@ |
49 | 49 | $this->headers[$type] = array( 'raw', htmlspecialchars($value) ); |
50 | 50 | } |
51 | 51 | |
| 52 | + // This is like so because jQuery got removed from core |
52 | 53 | public function setCSSJS() { |
53 | 54 | global $wgOut, $wgScriptPath; |
| 55 | + $prefix = "$wgScriptPath/extensions/Translate/js"; |
54 | 56 | // Our class |
55 | | - $wgOut->addScriptClass( 'JsEdit' ); |
| 57 | + $wgOut->addScriptFile( "$prefix/quickedit.js" ); |
56 | 58 | // Core jQuery |
57 | | - $wgOut->addScriptClass( 'j.ui' ); |
58 | | - $wgOut->addScriptClass( 'j.ui.dialog' ); |
59 | | - $wgOut->addScriptClass( 'j.ui.draggable' ); |
60 | | - $wgOut->addScriptClass( 'j.ui.resizable' ); |
| 59 | + $wgOut->addScriptFile( "$prefix/js2stopgap.js" ); |
61 | 60 | // Additional jQuery |
62 | | - $wgOut->addScriptClass( 'j.form' ); |
63 | | - // TODO: this can't be a good way... |
64 | | - $wgOut->addExtensionStyle( "$wgScriptPath/js2/mwEmbed/jquery/jquery.ui/themes/base/ui.all.css" ); |
| 61 | + $wgOut->addScriptFile( "$prefix/jquery.form.js" ); |
| 62 | + $wgOut->addExtensionStyle( "$prefix/base/ui.all.css" ); |
65 | 63 | } |
66 | 64 | |
67 | 65 | |
Index: trunk/extensions/Translate/utils/JsSelectToInput.php |
— | — | @@ -68,11 +68,7 @@ |
69 | 69 | if ( $done ) return; |
70 | 70 | |
71 | 71 | global $wgOut, $wgScriptPath; |
72 | | - if ( method_exists( $wgOut, 'addScriptClass' ) ) { |
73 | | - $wgOut->addScriptClass( 'JsSelectToInput' ); |
74 | | - } else { |
75 | | - $wgOut->addScriptFile( "$wgScriptPath/extensions/Translate/utils/JsSelectToInput.js" ); |
76 | | - } |
| 72 | + $wgOut->addScriptFile( "$wgScriptPath/extensions/Translate/utils/JsSelectToInput.js" ); |
77 | 73 | } |
78 | 74 | |
79 | 75 | } |
\ No newline at end of file |