www-thermferm/js/jquery-1.9.1.js

Tue, 08 Jul 2014 23:53:04 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 08 Jul 2014 23:53:04 +0200
changeset 97
4a9dbee41a6c
permissions
-rw-r--r--

Added initial set for the thermferm web interface

97
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*!
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * jQuery JavaScript Library v1.9.1
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 * http://jquery.com/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * Includes Sizzle.js
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * http://sizzlejs.com/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * Released under the MIT license
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * http://jquery.org/license
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * Date: 2013-2-4
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 (function( window, undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 // Can't do this because several apps including ASP.NET trace
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 // the stack via arguments.caller.callee and Firefox dies if
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 // you try to trace through "use strict" call chains. (#13335)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 // Support: Firefox 18+
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 //"use strict";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 var
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 // The deferred used on DOM ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 readyList,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 // A central reference to the root jQuery(document)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 rootjQuery,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 // For `typeof node.method` instead of `node.method !== undefined`
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 core_strundefined = typeof undefined,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 // Use the correct document accordingly with window argument (sandbox)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 document = window.document,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 location = window.location,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 // Map over jQuery in case of overwrite
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 _jQuery = window.jQuery,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 // Map over the $ in case of overwrite
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 _$ = window.$,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 // [[Class]] -> type pairs
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 class2type = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 // List of deleted data cache ids, so we can reuse them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 core_deletedIds = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 core_version = "1.9.1",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 // Save a reference to some core methods
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 core_concat = core_deletedIds.concat,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 core_push = core_deletedIds.push,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 core_slice = core_deletedIds.slice,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 core_indexOf = core_deletedIds.indexOf,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 core_toString = class2type.toString,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 core_hasOwn = class2type.hasOwnProperty,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 core_trim = core_version.trim,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 // Define a local copy of jQuery
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 jQuery = function( selector, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 // The jQuery object is actually just the init constructor 'enhanced'
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 return new jQuery.fn.init( selector, context, rootjQuery );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 // Used for matching numbers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 // Used for splitting on whitespace
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 core_rnotwhite = /\S+/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 // A simple way to check for HTML strings
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 // Strict HTML recognition (#11290: must start with <)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 // Match a standalone tag
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 // JSON RegExp
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 rvalidchars = /^[\],:{}\s]*$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 // Matches dashed string for camelizing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 rmsPrefix = /^-ms-/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 rdashAlpha = /-([\da-z])/gi,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 // Used by jQuery.camelCase as callback to replace()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 fcamelCase = function( all, letter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 return letter.toUpperCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 // The ready event handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 completed = function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 // readyState === "complete" is good enough for us to call the dom ready in oldIE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 detach();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 jQuery.ready();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 // Clean-up method for dom ready events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 detach = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 if ( document.addEventListener ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 document.removeEventListener( "DOMContentLoaded", completed, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 window.removeEventListener( "load", completed, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 document.detachEvent( "onreadystatechange", completed );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 window.detachEvent( "onload", completed );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 jQuery.fn = jQuery.prototype = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 // The current version of jQuery being used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 jquery: core_version,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 constructor: jQuery,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 init: function( selector, context, rootjQuery ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 var match, elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 // HANDLE: $(""), $(null), $(undefined), $(false)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 if ( !selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 // Handle HTML strings
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 if ( typeof selector === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 // Assume that strings that start and end with <> are HTML and skip the regex check
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 match = [ null, selector, null ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 match = rquickExpr.exec( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 // Match html or make sure no context is specified for #id
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 if ( match && (match[1] || !context) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 // HANDLE: $(html) -> $(array)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 if ( match[1] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 context = context instanceof jQuery ? context[0] : context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 // scripts is true for back-compat
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 jQuery.merge( this, jQuery.parseHTML(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 match[1],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 context && context.nodeType ? context.ownerDocument || context : document,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 // HANDLE: $(html, props)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 for ( match in context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 // Properties of context are called as methods if possible
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 if ( jQuery.isFunction( this[ match ] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 this[ match ]( context[ match ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 // ...and otherwise set as attributes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 this.attr( match, context[ match ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 // HANDLE: $(#id)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 elem = document.getElementById( match[2] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175 // Check parentNode to catch when Blackberry 4.6 returns
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 // nodes that are no longer in the document #6963
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 if ( elem && elem.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 // Handle the case where IE and Opera return items
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 // by name instead of ID
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 if ( elem.id !== match[2] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 return rootjQuery.find( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 // Otherwise, we inject the element directly into the jQuery object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 this.length = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 this[0] = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189 this.context = document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 this.selector = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 // HANDLE: $(expr, $(...))
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 } else if ( !context || context.jquery ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 return ( context || rootjQuery ).find( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 // HANDLE: $(expr, context)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 // (which is just equivalent to: $(context).find(expr)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 return this.constructor( context ).find( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 // HANDLE: $(DOMElement)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 } else if ( selector.nodeType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 this.context = this[0] = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 this.length = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 // HANDLE: $(function)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 // Shortcut for document ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 } else if ( jQuery.isFunction( selector ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 return rootjQuery.ready( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 if ( selector.selector !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 this.selector = selector.selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 this.context = selector.context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 return jQuery.makeArray( selector, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 // Start with an empty selector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 selector: "",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 // The default length of a jQuery object is 0
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228 length: 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 // The number of elements contained in the matched element set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 size: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 return this.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 toArray: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 return core_slice.call( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 // Get the Nth element in the matched element set OR
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 // Get the whole matched element set as a clean array
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 get: function( num ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 return num == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 // Return a 'clean' array
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 this.toArray() :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 // Return just the object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 ( num < 0 ? this[ this.length + num ] : this[ num ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 // Take an array of elements and push it onto the stack
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 // (returning the new matched element set)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 pushStack: function( elems ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 // Build a new jQuery matched element set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 var ret = jQuery.merge( this.constructor(), elems );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 // Add the old object onto the stack (as a reference)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
259 ret.prevObject = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 ret.context = this.context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 // Return the newly-formed element set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 // Execute a callback for every element in the matched set.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 // (You can seed the arguments with an array of args, but this is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 // only used internally.)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 each: function( callback, args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 return jQuery.each( this, callback, args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 ready: function( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 // Add the callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 jQuery.ready.promise().done( fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 slice: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 return this.pushStack( core_slice.apply( this, arguments ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 first: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 return this.eq( 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 last: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 return this.eq( -1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 eq: function( i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293 var len = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 j = +i + ( i < 0 ? len : 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 map: function( callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 return this.pushStack( jQuery.map(this, function( elem, i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 return callback.call( elem, i, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 }));
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 end: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 return this.prevObject || this.constructor(null);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 // For internal use only.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 // Behaves like an Array's method, not like a jQuery method.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 push: core_push,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 sort: [].sort,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 splice: [].splice
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 // Give the init function the jQuery prototype for later instantiation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 jQuery.fn.init.prototype = jQuery.fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 jQuery.extend = jQuery.fn.extend = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 var src, copyIsArray, copy, name, options, clone,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 target = arguments[0] || {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 i = 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 length = arguments.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 deep = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 // Handle a deep copy situation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 if ( typeof target === "boolean" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 deep = target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 target = arguments[1] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 // skip the boolean and the target
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 i = 2;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 // Handle case when target is a string or something (possible in deep copy)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 target = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 // extend jQuery itself if only one argument is passed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 if ( length === i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340 target = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 --i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
342 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 // Only deal with non-null/undefined values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 if ( (options = arguments[ i ]) != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 // Extend the base object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348 for ( name in options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 src = target[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 copy = options[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 // Prevent never-ending loop
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353 if ( target === copy ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 // Recurse if we're merging plain objects or arrays
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 if ( copyIsArray ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 copyIsArray = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 clone = src && jQuery.isArray(src) ? src : [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 clone = src && jQuery.isPlainObject(src) ? src : {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 // Never move original objects, clone them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368 target[ name ] = jQuery.extend( deep, clone, copy );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370 // Don't bring in undefined values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 } else if ( copy !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
372 target[ name ] = copy;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378 // Return the modified object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379 return target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 noConflict: function( deep ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 if ( window.$ === jQuery ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 window.$ = _$;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 if ( deep && window.jQuery === jQuery ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 window.jQuery = _jQuery;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 return jQuery;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
393 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 // Is the DOM ready to be used? Set to true once it occurs.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 isReady: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 // A counter to track how many items to wait for before
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399 // the ready event fires. See #6781
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400 readyWait: 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 // Hold (or release) the ready event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 holdReady: function( hold ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 if ( hold ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405 jQuery.readyWait++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
406 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
407 jQuery.ready( true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 // Handle when the DOM is ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412 ready: function( wait ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
413
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 // Abort if there are pending holds or we're already ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420 if ( !document.body ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
421 return setTimeout( jQuery.ready );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
422 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
423
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
424 // Remember that the DOM is ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
425 jQuery.isReady = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
426
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 // If a normal DOM Ready event fired, decrement, and wait if need be
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
428 if ( wait !== true && --jQuery.readyWait > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
429 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
430 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
431
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
432 // If there are functions bound, to execute
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
433 readyList.resolveWith( document, [ jQuery ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
434
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
435 // Trigger any bound ready events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
436 if ( jQuery.fn.trigger ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
437 jQuery( document ).trigger("ready").off("ready");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
438 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
439 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 // See test/unit/core.js for details concerning isFunction.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 // Since version 1.3, DOM methods and functions like alert
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 // aren't supported. They return false on IE (#2968).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 isFunction: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 return jQuery.type(obj) === "function";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 isArray: Array.isArray || function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 return jQuery.type(obj) === "array";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 isWindow: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 return obj != null && obj == obj.window;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456 isNumeric: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 return !isNaN( parseFloat(obj) ) && isFinite( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 type: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461 if ( obj == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
462 return String( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 return typeof obj === "object" || typeof obj === "function" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 class2type[ core_toString.call(obj) ] || "object" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466 typeof obj;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
468
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
469 isPlainObject: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 // Must be an Object.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
471 // Because of IE, we also have to check the presence of the constructor property.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
472 // Make sure that DOM nodes and window objects don't pass through, as well
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
473 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
474 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
475 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
476
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
477 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478 // Not own constructor property must be Object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 if ( obj.constructor &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 !core_hasOwn.call(obj, "constructor") &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485 // IE8,9 Will throw exceptions on certain host objects #9897
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
486 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
489 // Own properties are enumerated firstly, so to speed up,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
490 // if last one is own, then all properties are own.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
491
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
492 var key;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
493 for ( key in obj ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
494
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
495 return key === undefined || core_hasOwn.call( obj, key );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
496 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
497
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
498 isEmptyObject: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
499 var name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
500 for ( name in obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
501 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
502 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
503 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
504 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
505
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
506 error: function( msg ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
507 throw new Error( msg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
508 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
509
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
510 // data: string of html
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
511 // context (optional): If specified, the fragment will be created in this context, defaults to document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
512 // keepScripts (optional): If true, will include scripts passed in the html string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
513 parseHTML: function( data, context, keepScripts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
514 if ( !data || typeof data !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
515 return null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
516 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
517 if ( typeof context === "boolean" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
518 keepScripts = context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
519 context = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
520 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
521 context = context || document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
522
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
523 var parsed = rsingleTag.exec( data ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
524 scripts = !keepScripts && [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
525
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
526 // Single tag
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
527 if ( parsed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
528 return [ context.createElement( parsed[1] ) ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
529 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
530
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
531 parsed = jQuery.buildFragment( [ data ], context, scripts );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
532 if ( scripts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
533 jQuery( scripts ).remove();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
534 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
535 return jQuery.merge( [], parsed.childNodes );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
536 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
537
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
538 parseJSON: function( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
539 // Attempt to parse using the native JSON parser first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
540 if ( window.JSON && window.JSON.parse ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
541 return window.JSON.parse( data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
542 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
543
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
544 if ( data === null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
545 return data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
546 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
547
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
548 if ( typeof data === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
549
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
550 // Make sure leading/trailing whitespace is removed (IE can't handle it)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
551 data = jQuery.trim( data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
552
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
553 if ( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
554 // Make sure the incoming data is actual JSON
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
555 // Logic borrowed from http://json.org/json2.js
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
556 if ( rvalidchars.test( data.replace( rvalidescape, "@" )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
557 .replace( rvalidtokens, "]" )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
558 .replace( rvalidbraces, "")) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
559
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
560 return ( new Function( "return " + data ) )();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
561 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
563 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
564
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
565 jQuery.error( "Invalid JSON: " + data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
566 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
567
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
568 // Cross-browser xml parsing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
569 parseXML: function( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
570 var xml, tmp;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
571 if ( !data || typeof data !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
572 return null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
573 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
574 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
575 if ( window.DOMParser ) { // Standard
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
576 tmp = new DOMParser();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
577 xml = tmp.parseFromString( data , "text/xml" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
578 } else { // IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
579 xml = new ActiveXObject( "Microsoft.XMLDOM" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
580 xml.async = "false";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
581 xml.loadXML( data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
582 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
583 } catch( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
584 xml = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
585 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
586 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
587 jQuery.error( "Invalid XML: " + data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
588 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
589 return xml;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
590 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
591
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
592 noop: function() {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
593
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
594 // Evaluates a script in a global context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
595 // Workarounds based on findings by Jim Driscoll
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597 globalEval: function( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
598 if ( data && jQuery.trim( data ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 // We use execScript on Internet Explorer
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
600 // We use an anonymous function so that context is window
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
601 // rather than jQuery in Firefox
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
602 ( window.execScript || function( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 window[ "eval" ].call( window, data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
604 } )( data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
607
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
608 // Convert dashed to camelCase; used by the css and data modules
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
609 // Microsoft forgot to hump their vendor prefix (#9572)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
610 camelCase: function( string ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
611 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
612 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
613
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
614 nodeName: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
615 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
616 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
617
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
618 // args is for internal usage only
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
619 each: function( obj, callback, args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
620 var value,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
621 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
622 length = obj.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
623 isArray = isArraylike( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
624
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
625 if ( args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
626 if ( isArray ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
627 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
628 value = callback.apply( obj[ i ], args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
629
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
630 if ( value === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
631 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
632 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
633 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
634 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
635 for ( i in obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
636 value = callback.apply( obj[ i ], args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
637
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
638 if ( value === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
639 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
640 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
641 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
642 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
643
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
644 // A special, fast, case for the most common use of each
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
645 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
646 if ( isArray ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
647 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
648 value = callback.call( obj[ i ], i, obj[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
649
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
650 if ( value === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
651 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
652 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
653 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
654 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
655 for ( i in obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
656 value = callback.call( obj[ i ], i, obj[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
657
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
658 if ( value === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
659 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
660 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
661 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
662 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
663 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
664
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
665 return obj;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
667
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
668 // Use native String.trim function wherever possible
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
669 trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
670 function( text ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
671 return text == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
672 "" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
673 core_trim.call( text );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
674 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
675
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
676 // Otherwise use our own trimming functionality
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
677 function( text ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
678 return text == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
679 "" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
680 ( text + "" ).replace( rtrim, "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
681 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
682
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
683 // results is for internal usage only
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
684 makeArray: function( arr, results ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
685 var ret = results || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
686
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
687 if ( arr != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
688 if ( isArraylike( Object(arr) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
689 jQuery.merge( ret,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
690 typeof arr === "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
691 [ arr ] : arr
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
692 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
693 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
694 core_push.call( ret, arr );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
695 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
696 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
697
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
698 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
699 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
700
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
701 inArray: function( elem, arr, i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
702 var len;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
703
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
704 if ( arr ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
705 if ( core_indexOf ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
706 return core_indexOf.call( arr, elem, i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
707 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
708
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
709 len = arr.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
710 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
711
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
712 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
713 // Skip accessing in sparse arrays
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
714 if ( i in arr && arr[ i ] === elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
715 return i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
716 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
717 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
718 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
719
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
720 return -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
721 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
722
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
723 merge: function( first, second ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
724 var l = second.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
725 i = first.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
726 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
727
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
728 if ( typeof l === "number" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
729 for ( ; j < l; j++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
730 first[ i++ ] = second[ j ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
731 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
732 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
733 while ( second[j] !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
734 first[ i++ ] = second[ j++ ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
735 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
736 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
737
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
738 first.length = i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
739
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
740 return first;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
741 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
742
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
743 grep: function( elems, callback, inv ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
744 var retVal,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
745 ret = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
746 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
747 length = elems.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
748 inv = !!inv;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
749
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
750 // Go through the array, only saving the items
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
751 // that pass the validator function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
752 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
753 retVal = !!callback( elems[ i ], i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
754 if ( inv !== retVal ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
755 ret.push( elems[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
756 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
757 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
758
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
759 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
760 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
761
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
762 // arg is for internal usage only
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
763 map: function( elems, callback, arg ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
764 var value,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
765 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
766 length = elems.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
767 isArray = isArraylike( elems ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
768 ret = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
769
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
770 // Go through the array, translating each of the items to their
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
771 if ( isArray ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
772 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
773 value = callback( elems[ i ], i, arg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
774
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
775 if ( value != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
776 ret[ ret.length ] = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
777 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
778 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
779
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
780 // Go through every key on the object,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
781 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
782 for ( i in elems ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
783 value = callback( elems[ i ], i, arg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
784
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
785 if ( value != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
786 ret[ ret.length ] = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
787 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
788 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
789 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
790
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
791 // Flatten any nested arrays
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
792 return core_concat.apply( [], ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
793 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
794
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
795 // A global GUID counter for objects
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
796 guid: 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
797
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
798 // Bind a function to a context, optionally partially applying any
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
799 // arguments.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
800 proxy: function( fn, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
801 var args, proxy, tmp;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
802
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
803 if ( typeof context === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
804 tmp = fn[ context ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
805 context = fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
806 fn = tmp;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
807 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
808
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
809 // Quick check to determine if target is callable, in the spec
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
810 // this throws a TypeError, but we will just return undefined.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
811 if ( !jQuery.isFunction( fn ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
812 return undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
813 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
814
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
815 // Simulated bind
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
816 args = core_slice.call( arguments, 2 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
817 proxy = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
818 return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
819 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
820
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
821 // Set the guid of unique handler to the same of original handler, so it can be removed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
822 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
823
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
824 return proxy;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
825 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
826
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
827 // Multifunctional method to get and set values of a collection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
828 // The value/s can optionally be executed if it's a function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
829 access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
830 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
831 length = elems.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
832 bulk = key == null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
833
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
834 // Sets many values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
835 if ( jQuery.type( key ) === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
836 chainable = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
837 for ( i in key ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
838 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
839 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
840
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
841 // Sets one value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
842 } else if ( value !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
843 chainable = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
844
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
845 if ( !jQuery.isFunction( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
846 raw = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
847 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
848
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
849 if ( bulk ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
850 // Bulk operations run against the entire set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
851 if ( raw ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
852 fn.call( elems, value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
853 fn = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
854
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
855 // ...except when executing function values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
856 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
857 bulk = fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
858 fn = function( elem, key, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
859 return bulk.call( jQuery( elem ), value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
860 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
861 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
862 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
863
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
864 if ( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
865 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
866 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
867 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
868 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
869 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
870
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
871 return chainable ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
872 elems :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
873
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
874 // Gets
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
875 bulk ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
876 fn.call( elems ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
877 length ? fn( elems[0], key ) : emptyGet;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
878 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
879
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
880 now: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
881 return ( new Date() ).getTime();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
882 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
883 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
884
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
885 jQuery.ready.promise = function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
886 if ( !readyList ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
887
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
888 readyList = jQuery.Deferred();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
889
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
890 // Catch cases where $(document).ready() is called after the browser event has already occurred.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
891 // we once tried to use readyState "interactive" here, but it caused issues like the one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
892 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
893 if ( document.readyState === "complete" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
894 // Handle it asynchronously to allow scripts the opportunity to delay ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
895 setTimeout( jQuery.ready );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
896
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
897 // Standards-based browsers support DOMContentLoaded
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
898 } else if ( document.addEventListener ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
899 // Use the handy event callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
900 document.addEventListener( "DOMContentLoaded", completed, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
901
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
902 // A fallback to window.onload, that will always work
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
903 window.addEventListener( "load", completed, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
904
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
905 // If IE event model is used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
906 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
907 // Ensure firing before onload, maybe late but safe also for iframes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
908 document.attachEvent( "onreadystatechange", completed );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
909
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
910 // A fallback to window.onload, that will always work
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
911 window.attachEvent( "onload", completed );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
912
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
913 // If IE and not a frame
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
914 // continually check to see if the document is ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
915 var top = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
916
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
917 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
918 top = window.frameElement == null && document.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
919 } catch(e) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
920
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
921 if ( top && top.doScroll ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
922 (function doScrollCheck() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
923 if ( !jQuery.isReady ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
924
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
925 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
926 // Use the trick by Diego Perini
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
927 // http://javascript.nwbox.com/IEContentLoaded/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
928 top.doScroll("left");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
929 } catch(e) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
930 return setTimeout( doScrollCheck, 50 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
931 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
932
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
933 // detach all dom ready events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
934 detach();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
935
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
936 // and execute any waiting functions
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
937 jQuery.ready();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
938 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
939 })();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
940 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
941 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
942 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
943 return readyList.promise( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
944 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
945
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
946 // Populate the class2type map
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
947 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
948 class2type[ "[object " + name + "]" ] = name.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
949 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
950
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
951 function isArraylike( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
952 var length = obj.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
953 type = jQuery.type( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
954
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
955 if ( jQuery.isWindow( obj ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
956 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
957 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
958
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
959 if ( obj.nodeType === 1 && length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
960 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
961 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
962
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
963 return type === "array" || type !== "function" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
964 ( length === 0 ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
965 typeof length === "number" && length > 0 && ( length - 1 ) in obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
966 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
967
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
968 // All jQuery objects should point back to these
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
969 rootjQuery = jQuery(document);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
970 // String to Object options format cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
971 var optionsCache = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
972
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
973 // Convert String-formatted options into Object-formatted ones and store in cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
974 function createOptions( options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
975 var object = optionsCache[ options ] = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
976 jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
977 object[ flag ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
978 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
979 return object;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
980 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
981
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
982 /*
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
983 * Create a callback list using the following parameters:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
984 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
985 * options: an optional list of space-separated options that will change how
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
986 * the callback list behaves or a more traditional option object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
987 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
988 * By default a callback list will act like an event callback list and can be
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
989 * "fired" multiple times.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
990 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
991 * Possible options:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
992 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
993 * once: will ensure the callback list can only be fired once (like a Deferred)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
994 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
995 * memory: will keep track of previous values and will call any callback added
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
996 * after the list has been fired right away with the latest "memorized"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
997 * values (like a Deferred)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
998 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
999 * unique: will ensure a callback can only be added once (no duplicate in the list)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1000 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1001 * stopOnFalse: interrupt callings when a callback returns false
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1002 *
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1003 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1004 jQuery.Callbacks = function( options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1005
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1006 // Convert options from String-formatted to Object-formatted if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1007 // (we check in cache first)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1008 options = typeof options === "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1009 ( optionsCache[ options ] || createOptions( options ) ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1010 jQuery.extend( {}, options );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1011
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1012 var // Flag to know if list is currently firing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1013 firing,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1014 // Last fire value (for non-forgettable lists)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1015 memory,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1016 // Flag to know if list was already fired
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1017 fired,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1018 // End of the loop when firing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1019 firingLength,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1020 // Index of currently firing callback (modified by remove if needed)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1021 firingIndex,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1022 // First callback to fire (used internally by add and fireWith)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1023 firingStart,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1024 // Actual callback list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1025 list = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1026 // Stack of fire calls for repeatable lists
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1027 stack = !options.once && [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1028 // Fire callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1029 fire = function( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1030 memory = options.memory && data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1031 fired = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1032 firingIndex = firingStart || 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1033 firingStart = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1034 firingLength = list.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1035 firing = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1036 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1037 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1038 memory = false; // To prevent further calls using add
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1039 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1040 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1041 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1042 firing = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1043 if ( list ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1044 if ( stack ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1045 if ( stack.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1046 fire( stack.shift() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1047 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1048 } else if ( memory ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1049 list = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1050 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1051 self.disable();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1052 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1053 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1054 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1055 // Actual Callbacks object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1056 self = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1057 // Add a callback or a collection of callbacks to the list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1058 add: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1059 if ( list ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1060 // First, we save the current length
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1061 var start = list.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1062 (function add( args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1063 jQuery.each( args, function( _, arg ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1064 var type = jQuery.type( arg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1065 if ( type === "function" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1066 if ( !options.unique || !self.has( arg ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1067 list.push( arg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1068 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1069 } else if ( arg && arg.length && type !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1070 // Inspect recursively
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1071 add( arg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1072 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1073 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1074 })( arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1075 // Do we need to add the callbacks to the
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1076 // current firing batch?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1077 if ( firing ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1078 firingLength = list.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1079 // With memory, if we're not firing then
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1080 // we should call right away
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1081 } else if ( memory ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1082 firingStart = start;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1083 fire( memory );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1084 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1085 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1086 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1087 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1088 // Remove a callback from the list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1089 remove: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1090 if ( list ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1091 jQuery.each( arguments, function( _, arg ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1092 var index;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1093 while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1094 list.splice( index, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1095 // Handle firing indexes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1096 if ( firing ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1097 if ( index <= firingLength ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1098 firingLength--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1099 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1100 if ( index <= firingIndex ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1101 firingIndex--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1102 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1103 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1104 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1105 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1106 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1107 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1108 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1109 // Check if a given callback is in the list.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1110 // If no argument is given, return whether or not list has callbacks attached.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1111 has: function( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1112 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1113 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1114 // Remove all callbacks from the list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1115 empty: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1116 list = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1117 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1118 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1119 // Have the list do nothing anymore
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1120 disable: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1121 list = stack = memory = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1122 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1123 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1124 // Is it disabled?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1125 disabled: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1126 return !list;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1127 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1128 // Lock the list in its current state
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1129 lock: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1130 stack = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1131 if ( !memory ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1132 self.disable();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1133 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1134 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1135 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1136 // Is it locked?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1137 locked: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1138 return !stack;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1139 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1140 // Call all callbacks with the given context and arguments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1141 fireWith: function( context, args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1142 args = args || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1143 args = [ context, args.slice ? args.slice() : args ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1144 if ( list && ( !fired || stack ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1145 if ( firing ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1146 stack.push( args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1147 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1148 fire( args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1149 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1150 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1151 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1152 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1153 // Call all the callbacks with the given arguments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1154 fire: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1155 self.fireWith( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1156 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1157 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1158 // To know if the callbacks have already been called at least once
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1159 fired: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1160 return !!fired;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1161 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1162 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1163
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1164 return self;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1165 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1166 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1167
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1168 Deferred: function( func ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1169 var tuples = [
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1170 // action, add listener, listener list, final state
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1171 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1172 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1173 [ "notify", "progress", jQuery.Callbacks("memory") ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1174 ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1175 state = "pending",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1176 promise = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1177 state: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1178 return state;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1179 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1180 always: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1181 deferred.done( arguments ).fail( arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1182 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1183 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1184 then: function( /* fnDone, fnFail, fnProgress */ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1185 var fns = arguments;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1186 return jQuery.Deferred(function( newDefer ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1187 jQuery.each( tuples, function( i, tuple ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1188 var action = tuple[ 0 ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1189 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1190 // deferred[ done | fail | progress ] for forwarding actions to newDefer
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1191 deferred[ tuple[1] ](function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1192 var returned = fn && fn.apply( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1193 if ( returned && jQuery.isFunction( returned.promise ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1194 returned.promise()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1195 .done( newDefer.resolve )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1196 .fail( newDefer.reject )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1197 .progress( newDefer.notify );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1198 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1199 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1200 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1201 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1202 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1203 fns = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1204 }).promise();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1205 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1206 // Get a promise for this deferred
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1207 // If obj is provided, the promise aspect is added to the object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1208 promise: function( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1209 return obj != null ? jQuery.extend( obj, promise ) : promise;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1210 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1211 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1212 deferred = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1213
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1214 // Keep pipe for back-compat
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1215 promise.pipe = promise.then;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1216
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1217 // Add list-specific methods
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1218 jQuery.each( tuples, function( i, tuple ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1219 var list = tuple[ 2 ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1220 stateString = tuple[ 3 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1221
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1222 // promise[ done | fail | progress ] = list.add
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1223 promise[ tuple[1] ] = list.add;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1224
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1225 // Handle state
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1226 if ( stateString ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1227 list.add(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1228 // state = [ resolved | rejected ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1229 state = stateString;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1230
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1231 // [ reject_list | resolve_list ].disable; progress_list.lock
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1232 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1233 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1234
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1235 // deferred[ resolve | reject | notify ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1236 deferred[ tuple[0] ] = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1237 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1238 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1239 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1240 deferred[ tuple[0] + "With" ] = list.fireWith;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1241 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1242
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1243 // Make the deferred a promise
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1244 promise.promise( deferred );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1245
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1246 // Call given func if any
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1247 if ( func ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1248 func.call( deferred, deferred );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1250
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1251 // All done!
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1252 return deferred;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1253 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1254
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1255 // Deferred helper
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1256 when: function( subordinate /* , ..., subordinateN */ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1257 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1258 resolveValues = core_slice.call( arguments ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1259 length = resolveValues.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1260
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1261 // the count of uncompleted subordinates
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1262 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1263
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1264 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1265 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1266
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1267 // Update function for both resolve and progress values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1268 updateFunc = function( i, contexts, values ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1269 return function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1270 contexts[ i ] = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1271 values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1272 if( values === progressValues ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1273 deferred.notifyWith( contexts, values );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1274 } else if ( !( --remaining ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1275 deferred.resolveWith( contexts, values );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1276 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1277 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1278 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1279
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1280 progressValues, progressContexts, resolveContexts;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1281
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1282 // add listeners to Deferred subordinates; treat others as resolved
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1283 if ( length > 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1284 progressValues = new Array( length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1285 progressContexts = new Array( length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1286 resolveContexts = new Array( length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1287 for ( ; i < length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1288 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1289 resolveValues[ i ].promise()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1290 .done( updateFunc( i, resolveContexts, resolveValues ) )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1291 .fail( deferred.reject )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1292 .progress( updateFunc( i, progressContexts, progressValues ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1293 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1294 --remaining;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1295 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1296 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1297 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1298
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1299 // if we're not waiting on anything, resolve the master
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1300 if ( !remaining ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1301 deferred.resolveWith( resolveContexts, resolveValues );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1302 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1303
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1304 return deferred.promise();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1305 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1306 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1307 jQuery.support = (function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1308
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1309 var support, all, a,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1310 input, select, fragment,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1311 opt, eventName, isSupported, i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1312 div = document.createElement("div");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1313
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1314 // Setup
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1315 div.setAttribute( "className", "t" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1316 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1317
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1318 // Support tests won't run in some limited or non-browser environments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1319 all = div.getElementsByTagName("*");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1320 a = div.getElementsByTagName("a")[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1321 if ( !all || !a || !all.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1322 return {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1323 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1324
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1325 // First batch of tests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1326 select = document.createElement("select");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1327 opt = select.appendChild( document.createElement("option") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1328 input = div.getElementsByTagName("input")[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1329
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1330 a.style.cssText = "top:1px;float:left;opacity:.5";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1331 support = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1332 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1333 getSetAttribute: div.className !== "t",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1334
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1335 // IE strips leading whitespace when .innerHTML is used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1336 leadingWhitespace: div.firstChild.nodeType === 3,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1337
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1338 // Make sure that tbody elements aren't automatically inserted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1339 // IE will insert them into empty tables
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1340 tbody: !div.getElementsByTagName("tbody").length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1341
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1342 // Make sure that link elements get serialized correctly by innerHTML
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1343 // This requires a wrapper element in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1344 htmlSerialize: !!div.getElementsByTagName("link").length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1345
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1346 // Get the style information from getAttribute
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1347 // (IE uses .cssText instead)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1348 style: /top/.test( a.getAttribute("style") ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1349
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1350 // Make sure that URLs aren't manipulated
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1351 // (IE normalizes it by default)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1352 hrefNormalized: a.getAttribute("href") === "/a",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1353
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1354 // Make sure that element opacity exists
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1355 // (IE uses filter instead)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1356 // Use a regex to work around a WebKit issue. See #5145
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1357 opacity: /^0.5/.test( a.style.opacity ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1358
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1359 // Verify style float existence
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1360 // (IE uses styleFloat instead of cssFloat)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1361 cssFloat: !!a.style.cssFloat,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1362
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1363 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1364 checkOn: !!input.value,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1365
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1366 // Make sure that a selected-by-default option has a working selected property.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1367 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1368 optSelected: opt.selected,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1369
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1370 // Tests for enctype support on a form (#6743)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1371 enctype: !!document.createElement("form").enctype,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1372
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1373 // Makes sure cloning an html5 element does not cause problems
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1374 // Where outerHTML is undefined, this still works
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1375 html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1376
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1377 // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1378 boxModel: document.compatMode === "CSS1Compat",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1379
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1380 // Will be defined later
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1381 deleteExpando: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1382 noCloneEvent: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1383 inlineBlockNeedsLayout: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1384 shrinkWrapBlocks: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1385 reliableMarginRight: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1386 boxSizingReliable: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1387 pixelPosition: false
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1388 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1389
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1390 // Make sure checked status is properly cloned
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1391 input.checked = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1392 support.noCloneChecked = input.cloneNode( true ).checked;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1393
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1394 // Make sure that the options inside disabled selects aren't marked as disabled
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1395 // (WebKit marks them as disabled)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1396 select.disabled = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1397 support.optDisabled = !opt.disabled;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1398
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1399 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1400 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1401 delete div.test;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1402 } catch( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1403 support.deleteExpando = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1404 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1405
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1406 // Check if we can trust getAttribute("value")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1407 input = document.createElement("input");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1408 input.setAttribute( "value", "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1409 support.input = input.getAttribute( "value" ) === "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1410
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1411 // Check if an input maintains its value after becoming a radio
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1412 input.value = "t";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1413 input.setAttribute( "type", "radio" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1414 support.radioValue = input.value === "t";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1415
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1416 // #11217 - WebKit loses check when the name is after the checked attribute
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1417 input.setAttribute( "checked", "t" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1418 input.setAttribute( "name", "t" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1419
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1420 fragment = document.createDocumentFragment();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1421 fragment.appendChild( input );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1422
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1423 // Check if a disconnected checkbox will retain its checked
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1424 // value of true after appended to the DOM (IE6/7)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1425 support.appendChecked = input.checked;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1426
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1427 // WebKit doesn't clone checked state correctly in fragments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1428 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1429
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1430 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1431 // Opera does not clone events (and typeof div.attachEvent === undefined).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1432 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1433 if ( div.attachEvent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1434 div.attachEvent( "onclick", function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1435 support.noCloneEvent = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1436 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1437
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1438 div.cloneNode( true ).click();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1439 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1440
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1441 // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1442 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1443 for ( i in { submit: true, change: true, focusin: true }) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1444 div.setAttribute( eventName = "on" + i, "t" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1445
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1446 support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1447 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1448
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1449 div.style.backgroundClip = "content-box";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1450 div.cloneNode( true ).style.backgroundClip = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1451 support.clearCloneStyle = div.style.backgroundClip === "content-box";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1452
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1453 // Run tests that need a body at doc ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1454 jQuery(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1455 var container, marginDiv, tds,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1456 divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1457 body = document.getElementsByTagName("body")[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1458
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1459 if ( !body ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1460 // Return for frameset docs that don't have a body
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1461 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1462 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1463
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1464 container = document.createElement("div");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1465 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1466
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1467 body.appendChild( container ).appendChild( div );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1468
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1469 // Support: IE8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1470 // Check if table cells still have offsetWidth/Height when they are set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1471 // to display:none and there are still other visible table cells in a
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1472 // table row; if so, offsetWidth/Height are not reliable for use when
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1473 // determining if an element has been hidden directly using
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1474 // display:none (it is still safe to use offsets if a parent element is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1475 // hidden; don safety goggles and see bug #4512 for more information).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1476 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1477 tds = div.getElementsByTagName("td");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1478 tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1479 isSupported = ( tds[ 0 ].offsetHeight === 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1480
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1481 tds[ 0 ].style.display = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1482 tds[ 1 ].style.display = "none";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1483
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1484 // Support: IE8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1485 // Check if empty table cells still have offsetWidth/Height
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1486 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1487
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1488 // Check box-sizing and margin behavior
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1489 div.innerHTML = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1490 div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1491 support.boxSizing = ( div.offsetWidth === 4 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1492 support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1493
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1494 // Use window.getComputedStyle because jsdom on node.js will break without it.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1495 if ( window.getComputedStyle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1496 support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1497 support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1498
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1499 // Check if div with explicit width and no margin-right incorrectly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1500 // gets computed margin-right based on width of container. (#3333)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1501 // Fails in WebKit before Feb 2011 nightlies
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1502 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1503 marginDiv = div.appendChild( document.createElement("div") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1504 marginDiv.style.cssText = div.style.cssText = divReset;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1505 marginDiv.style.marginRight = marginDiv.style.width = "0";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1506 div.style.width = "1px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1507
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1508 support.reliableMarginRight =
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1509 !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1510 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1511
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1512 if ( typeof div.style.zoom !== core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1513 // Support: IE<8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1514 // Check if natively block-level elements act like inline-block
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1515 // elements when setting their display to 'inline' and giving
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1516 // them layout
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1517 div.innerHTML = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1518 div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1519 support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1520
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1521 // Support: IE6
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1522 // Check if elements with layout shrink-wrap their children
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1523 div.style.display = "block";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1524 div.innerHTML = "<div></div>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1525 div.firstChild.style.width = "5px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1526 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1527
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1528 if ( support.inlineBlockNeedsLayout ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1529 // Prevent IE 6 from affecting layout for positioned elements #11048
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1530 // Prevent IE from shrinking the body in IE 7 mode #12869
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1531 // Support: IE<8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1532 body.style.zoom = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1533 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1534 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1535
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1536 body.removeChild( container );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1537
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1538 // Null elements to avoid leaks in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1539 container = div = tds = marginDiv = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1540 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1541
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1542 // Null elements to avoid leaks in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1543 all = select = fragment = opt = a = input = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1544
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1545 return support;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1546 })();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1547
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1548 var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1549 rmultiDash = /([A-Z])/g;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1550
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1551 function internalData( elem, name, data, pvt /* Internal Use Only */ ){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1552 if ( !jQuery.acceptData( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1553 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1554 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1555
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1556 var thisCache, ret,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1557 internalKey = jQuery.expando,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1558 getByName = typeof name === "string",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1559
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1560 // We have to handle DOM nodes and JS objects differently because IE6-7
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1561 // can't GC object references properly across the DOM-JS boundary
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1562 isNode = elem.nodeType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1563
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1564 // Only DOM nodes need the global jQuery cache; JS object data is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1565 // attached directly to the object so GC can occur automatically
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1566 cache = isNode ? jQuery.cache : elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1567
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1568 // Only defining an ID for JS objects if its cache already exists allows
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1569 // the code to shortcut on the same path as a DOM node with no cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1570 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1571
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1572 // Avoid doing any more work than we need to when trying to get data on an
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1573 // object that has no data at all
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1574 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1575 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1576 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1577
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1578 if ( !id ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1579 // Only DOM nodes need a new unique ID for each element since their data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1580 // ends up in the global cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1581 if ( isNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1582 elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1583 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1584 id = internalKey;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1585 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1586 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1587
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1588 if ( !cache[ id ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1589 cache[ id ] = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1590
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1591 // Avoids exposing jQuery metadata on plain JS objects when the object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1592 // is serialized using JSON.stringify
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1593 if ( !isNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1594 cache[ id ].toJSON = jQuery.noop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1595 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1596 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1597
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1598 // An object can be passed to jQuery.data instead of a key/value pair; this gets
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1599 // shallow copied over onto the existing cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1600 if ( typeof name === "object" || typeof name === "function" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1601 if ( pvt ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1602 cache[ id ] = jQuery.extend( cache[ id ], name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1603 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1604 cache[ id ].data = jQuery.extend( cache[ id ].data, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1605 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1606 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1607
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1608 thisCache = cache[ id ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1609
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1610 // jQuery data() is stored in a separate object inside the object's internal data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1611 // cache in order to avoid key collisions between internal data and user-defined
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1612 // data.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1613 if ( !pvt ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1614 if ( !thisCache.data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1615 thisCache.data = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1616 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1617
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1618 thisCache = thisCache.data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1619 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1620
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1621 if ( data !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1622 thisCache[ jQuery.camelCase( name ) ] = data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1623 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1624
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1625 // Check for both converted-to-camel and non-converted data property names
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1626 // If a data property was specified
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1627 if ( getByName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1628
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1629 // First Try to find as-is property data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1630 ret = thisCache[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1631
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1632 // Test for null|undefined property data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1633 if ( ret == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1634
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1635 // Try to find the camelCased property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1636 ret = thisCache[ jQuery.camelCase( name ) ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1637 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1638 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1639 ret = thisCache;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1640 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1641
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1642 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1643 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1644
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1645 function internalRemoveData( elem, name, pvt ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1646 if ( !jQuery.acceptData( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1647 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1648 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1649
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1650 var i, l, thisCache,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1651 isNode = elem.nodeType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1652
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1653 // See jQuery.data for more information
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1654 cache = isNode ? jQuery.cache : elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1655 id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1656
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1657 // If there is already no cache entry for this object, there is no
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1658 // purpose in continuing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1659 if ( !cache[ id ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1660 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1661 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1662
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1663 if ( name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1664
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1665 thisCache = pvt ? cache[ id ] : cache[ id ].data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1666
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1667 if ( thisCache ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1668
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1669 // Support array or space separated string names for data keys
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1670 if ( !jQuery.isArray( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1671
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1672 // try the string as a key before any manipulation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1673 if ( name in thisCache ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1674 name = [ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1675 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1676
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1677 // split the camel cased version by spaces unless a key with the spaces exists
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1678 name = jQuery.camelCase( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1679 if ( name in thisCache ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1680 name = [ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1681 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1682 name = name.split(" ");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1683 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1684 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1685 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1686 // If "name" is an array of keys...
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1687 // When data is initially created, via ("key", "val") signature,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1688 // keys will be converted to camelCase.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1689 // Since there is no way to tell _how_ a key was added, remove
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1690 // both plain key and camelCase key. #12786
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1691 // This will only penalize the array argument path.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1692 name = name.concat( jQuery.map( name, jQuery.camelCase ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1693 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1694
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1695 for ( i = 0, l = name.length; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1696 delete thisCache[ name[i] ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1697 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1698
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1699 // If there is no data left in the cache, we want to continue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1700 // and let the cache object itself get destroyed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1701 if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1702 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1703 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1704 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1705 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1706
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1707 // See jQuery.data for more information
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1708 if ( !pvt ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1709 delete cache[ id ].data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1710
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1711 // Don't destroy the parent cache unless the internal data object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1712 // had been the only thing left in it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1713 if ( !isEmptyDataObject( cache[ id ] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1714 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1715 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1716 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1717
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1718 // Destroy the cache
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1719 if ( isNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1720 jQuery.cleanData( [ elem ], true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1721
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1722 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1723 } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1724 delete cache[ id ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1725
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1726 // When all else fails, null
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1727 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1728 cache[ id ] = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1729 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1730 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1731
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1732 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1733 cache: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1734
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1735 // Unique for each copy of jQuery on the page
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1736 // Non-digits removed to match rinlinejQuery
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1737 expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1738
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1739 // The following elements throw uncatchable exceptions if you
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1740 // attempt to add expando properties to them.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1741 noData: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1742 "embed": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1743 // Ban all objects except for Flash (which handle expandos)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1744 "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1745 "applet": true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1746 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1747
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1748 hasData: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1749 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1750 return !!elem && !isEmptyDataObject( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1751 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1752
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1753 data: function( elem, name, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1754 return internalData( elem, name, data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1755 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1756
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1757 removeData: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1758 return internalRemoveData( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1759 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1760
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1761 // For internal use only.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1762 _data: function( elem, name, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1763 return internalData( elem, name, data, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1764 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1765
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1766 _removeData: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1767 return internalRemoveData( elem, name, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1768 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1769
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1770 // A method for determining if a DOM node can handle the data expando
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1771 acceptData: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1772 // Do not set data on non-element because it will not be cleared (#8335).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1773 if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1774 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1775 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1776
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1777 var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1778
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1779 // nodes accept data unless otherwise specified; rejection can be conditional
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1780 return !noData || noData !== true && elem.getAttribute("classid") === noData;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1781 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1782 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1783
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1784 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1785 data: function( key, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1786 var attrs, name,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1787 elem = this[0],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1788 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1789 data = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1790
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1791 // Gets all values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1792 if ( key === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1793 if ( this.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1794 data = jQuery.data( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1795
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1796 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1797 attrs = elem.attributes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1798 for ( ; i < attrs.length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1799 name = attrs[i].name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1800
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1801 if ( !name.indexOf( "data-" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1802 name = jQuery.camelCase( name.slice(5) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1803
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1804 dataAttr( elem, name, data[ name ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1805 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1806 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1807 jQuery._data( elem, "parsedAttrs", true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1808 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1809 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1810
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1811 return data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1812 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1813
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1814 // Sets multiple values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1815 if ( typeof key === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1816 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1817 jQuery.data( this, key );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1818 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1819 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1820
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1821 return jQuery.access( this, function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1823 if ( value === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1824 // Try to fetch any internally stored data first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1825 return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1826 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1827
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1828 this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1829 jQuery.data( this, key, value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1830 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1831 }, null, value, arguments.length > 1, null, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1832 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1833
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1834 removeData: function( key ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1835 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1836 jQuery.removeData( this, key );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1837 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1838 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1839 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1840
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1841 function dataAttr( elem, key, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1842 // If nothing was found internally, try to fetch any
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1843 // data from the HTML5 data-* attribute
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1844 if ( data === undefined && elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1845
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1846 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1847
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1848 data = elem.getAttribute( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1849
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1850 if ( typeof data === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1851 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1852 data = data === "true" ? true :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1853 data === "false" ? false :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1854 data === "null" ? null :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1855 // Only convert to a number if it doesn't change the string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1856 +data + "" === data ? +data :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1857 rbrace.test( data ) ? jQuery.parseJSON( data ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1858 data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1859 } catch( e ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1860
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1861 // Make sure we set the data so it isn't changed later
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1862 jQuery.data( elem, key, data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1863
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1864 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1865 data = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1866 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1867 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1868
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1869 return data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1870 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1871
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1872 // checks a cache object for emptiness
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1873 function isEmptyDataObject( obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1874 var name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1875 for ( name in obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1876
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1877 // if the public data object is empty, the private is still empty
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1878 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1879 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1880 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1881 if ( name !== "toJSON" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1882 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1883 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1884 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1885
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1886 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1887 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1888 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1889 queue: function( elem, type, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1890 var queue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1891
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1892 if ( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1893 type = ( type || "fx" ) + "queue";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1894 queue = jQuery._data( elem, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1895
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1896 // Speed up dequeue by getting out quickly if this is just a lookup
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1897 if ( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1898 if ( !queue || jQuery.isArray(data) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1899 queue = jQuery._data( elem, type, jQuery.makeArray(data) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1900 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1901 queue.push( data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1902 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1903 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1904 return queue || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1905 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1906 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1907
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1908 dequeue: function( elem, type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1909 type = type || "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1910
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1911 var queue = jQuery.queue( elem, type ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1912 startLength = queue.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1913 fn = queue.shift(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1914 hooks = jQuery._queueHooks( elem, type ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1915 next = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1916 jQuery.dequeue( elem, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1917 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1918
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1919 // If the fx queue is dequeued, always remove the progress sentinel
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1920 if ( fn === "inprogress" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1921 fn = queue.shift();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1922 startLength--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1923 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1924
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1925 hooks.cur = fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1926 if ( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1927
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1928 // Add a progress sentinel to prevent the fx queue from being
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1929 // automatically dequeued
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1930 if ( type === "fx" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1931 queue.unshift( "inprogress" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1932 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1933
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1934 // clear up the last queue stop function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1935 delete hooks.stop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1936 fn.call( elem, next, hooks );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1937 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1938
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1939 if ( !startLength && hooks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1940 hooks.empty.fire();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1941 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1942 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1943
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1944 // not intended for public consumption - generates a queueHooks object, or returns the current one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1945 _queueHooks: function( elem, type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1946 var key = type + "queueHooks";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1947 return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1948 empty: jQuery.Callbacks("once memory").add(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1949 jQuery._removeData( elem, type + "queue" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1950 jQuery._removeData( elem, key );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1951 })
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1952 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1953 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1954 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1955
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1956 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1957 queue: function( type, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1958 var setter = 2;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1959
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1960 if ( typeof type !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1961 data = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1962 type = "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1963 setter--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1964 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1965
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1966 if ( arguments.length < setter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1967 return jQuery.queue( this[0], type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1968 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1969
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1970 return data === undefined ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1971 this :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1972 this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1973 var queue = jQuery.queue( this, type, data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1974
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1975 // ensure a hooks for this queue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1976 jQuery._queueHooks( this, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1977
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1978 if ( type === "fx" && queue[0] !== "inprogress" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1979 jQuery.dequeue( this, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1980 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1981 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1982 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1983 dequeue: function( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1984 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1985 jQuery.dequeue( this, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1986 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1987 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1988 // Based off of the plugin by Clint Helfers, with permission.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1989 // http://blindsignals.com/index.php/2009/07/jquery-delay/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1990 delay: function( time, type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1991 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1992 type = type || "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1993
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1994 return this.queue( type, function( next, hooks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1995 var timeout = setTimeout( next, time );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1996 hooks.stop = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1997 clearTimeout( timeout );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1998 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1999 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2000 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2001 clearQueue: function( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2002 return this.queue( type || "fx", [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2003 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2004 // Get a promise resolved when queues of a certain type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2005 // are emptied (fx is the type by default)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2006 promise: function( type, obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2007 var tmp,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2008 count = 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2009 defer = jQuery.Deferred(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2010 elements = this,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2011 i = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2012 resolve = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2013 if ( !( --count ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2014 defer.resolveWith( elements, [ elements ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2015 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2016 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2017
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2018 if ( typeof type !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2019 obj = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2020 type = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2021 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2022 type = type || "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2023
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2024 while( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2025 tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2026 if ( tmp && tmp.empty ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2027 count++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2028 tmp.empty.add( resolve );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2029 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2030 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2031 resolve();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2032 return defer.promise( obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2033 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2034 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2035 var nodeHook, boolHook,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2036 rclass = /[\t\r\n]/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2037 rreturn = /\r/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2038 rfocusable = /^(?:input|select|textarea|button|object)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2039 rclickable = /^(?:a|area)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2040 rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2041 ruseDefault = /^(?:checked|selected)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2042 getSetAttribute = jQuery.support.getSetAttribute,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2043 getSetInput = jQuery.support.input;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2044
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2045 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2046 attr: function( name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2047 return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2048 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2049
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2050 removeAttr: function( name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2051 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2052 jQuery.removeAttr( this, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2053 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2054 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2055
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2056 prop: function( name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2057 return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2058 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2059
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2060 removeProp: function( name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2061 name = jQuery.propFix[ name ] || name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2062 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2063 // try/catch handles cases where IE balks (such as removing a property on window)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2064 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2065 this[ name ] = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2066 delete this[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2067 } catch( e ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2068 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2069 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2070
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2071 addClass: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2072 var classes, elem, cur, clazz, j,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2073 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2074 len = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2075 proceed = typeof value === "string" && value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2076
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2077 if ( jQuery.isFunction( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2078 return this.each(function( j ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2079 jQuery( this ).addClass( value.call( this, j, this.className ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2080 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2081 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2082
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2083 if ( proceed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2084 // The disjunction here is for better compressibility (see removeClass)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2085 classes = ( value || "" ).match( core_rnotwhite ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2086
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2087 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2088 elem = this[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2089 cur = elem.nodeType === 1 && ( elem.className ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2090 ( " " + elem.className + " " ).replace( rclass, " " ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2091 " "
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2092 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2093
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2094 if ( cur ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2095 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2096 while ( (clazz = classes[j++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2097 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2098 cur += clazz + " ";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2099 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2100 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2101 elem.className = jQuery.trim( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2102
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2103 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2104 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2105 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2106
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2107 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2108 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2109
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2110 removeClass: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2111 var classes, elem, cur, clazz, j,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2112 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2113 len = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2114 proceed = arguments.length === 0 || typeof value === "string" && value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2115
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2116 if ( jQuery.isFunction( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2117 return this.each(function( j ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2118 jQuery( this ).removeClass( value.call( this, j, this.className ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2119 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2120 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2121 if ( proceed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2122 classes = ( value || "" ).match( core_rnotwhite ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2123
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2124 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2125 elem = this[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2126 // This expression is here for better compressibility (see addClass)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2127 cur = elem.nodeType === 1 && ( elem.className ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2128 ( " " + elem.className + " " ).replace( rclass, " " ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2129 ""
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2130 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2131
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2132 if ( cur ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2133 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2134 while ( (clazz = classes[j++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2135 // Remove *all* instances
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2136 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2137 cur = cur.replace( " " + clazz + " ", " " );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2138 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2139 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2140 elem.className = value ? jQuery.trim( cur ) : "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2141 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2142 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2143 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2144
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2145 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2146 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2147
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2148 toggleClass: function( value, stateVal ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2149 var type = typeof value,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2150 isBool = typeof stateVal === "boolean";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2151
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2152 if ( jQuery.isFunction( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2153 return this.each(function( i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2154 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2155 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2156 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2157
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2158 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2159 if ( type === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2160 // toggle individual class names
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2161 var className,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2162 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2163 self = jQuery( this ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2164 state = stateVal,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2165 classNames = value.match( core_rnotwhite ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2166
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2167 while ( (className = classNames[ i++ ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2168 // check each className given, space separated list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2169 state = isBool ? state : !self.hasClass( className );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2170 self[ state ? "addClass" : "removeClass" ]( className );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2171 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2172
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2173 // Toggle whole class name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2174 } else if ( type === core_strundefined || type === "boolean" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2175 if ( this.className ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2176 // store className if set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2177 jQuery._data( this, "__className__", this.className );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2178 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2179
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2180 // If the element has a class name or if we're passed "false",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2181 // then remove the whole classname (if there was one, the above saved it).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2182 // Otherwise bring back whatever was previously saved (if anything),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2183 // falling back to the empty string if nothing was stored.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2184 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2185 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2186 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2187 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2188
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2189 hasClass: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2190 var className = " " + selector + " ",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2191 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2192 l = this.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2193 for ( ; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2194 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2195 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2196 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2197 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2198
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2199 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2200 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2201
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2202 val: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2203 var ret, hooks, isFunction,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2204 elem = this[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2205
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2206 if ( !arguments.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2207 if ( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2208 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2209
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2210 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2211 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2212 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2213
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2214 ret = elem.value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2215
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2216 return typeof ret === "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2217 // handle most common string cases
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2218 ret.replace(rreturn, "") :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2219 // handle cases where value is null/undef or number
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2220 ret == null ? "" : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2221 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2222
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2223 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2224 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2225
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2226 isFunction = jQuery.isFunction( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2227
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2228 return this.each(function( i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2229 var val,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2230 self = jQuery(this);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2231
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2232 if ( this.nodeType !== 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2233 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2234 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2235
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2236 if ( isFunction ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2237 val = value.call( this, i, self.val() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2238 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2239 val = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2240 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2241
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2242 // Treat null/undefined as ""; convert numbers to string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2243 if ( val == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2244 val = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2245 } else if ( typeof val === "number" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2246 val += "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2247 } else if ( jQuery.isArray( val ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2248 val = jQuery.map(val, function ( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2249 return value == null ? "" : value + "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2250 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2251 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2252
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2253 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2254
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2255 // If set returns undefined, fall back to normal setting
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2256 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2257 this.value = val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2258 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2259 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2260 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2261 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2262
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2263 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2264 valHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2265 option: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2266 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2267 // attributes.value is undefined in Blackberry 4.7 but
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2268 // uses .value. See #6932
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2269 var val = elem.attributes.value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2270 return !val || val.specified ? elem.value : elem.text;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2271 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2272 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2273 select: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2274 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2275 var value, option,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2276 options = elem.options,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2277 index = elem.selectedIndex,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2278 one = elem.type === "select-one" || index < 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2279 values = one ? null : [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2280 max = one ? index + 1 : options.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2281 i = index < 0 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2282 max :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2283 one ? index : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2284
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2285 // Loop through all the selected options
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2286 for ( ; i < max; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2287 option = options[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2288
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2289 // oldIE doesn't update selected after form reset (#2551)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2290 if ( ( option.selected || i === index ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2291 // Don't return options that are disabled or in a disabled optgroup
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2292 ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2293 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2294
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2295 // Get the specific value for the option
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2296 value = jQuery( option ).val();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2297
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2298 // We don't need an array for one selects
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2299 if ( one ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2300 return value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2301 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2302
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2303 // Multi-Selects return an array
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2304 values.push( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2305 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2306 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2307
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2308 return values;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2309 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2310
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2311 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2312 var values = jQuery.makeArray( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2313
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2314 jQuery(elem).find("option").each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2315 this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2316 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2317
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2318 if ( !values.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2319 elem.selectedIndex = -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2320 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2321 return values;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2322 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2323 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2324 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2325
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2326 attr: function( elem, name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2327 var hooks, notxml, ret,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2328 nType = elem.nodeType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2329
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2330 // don't get/set attributes on text, comment and attribute nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2331 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2332 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2333 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2334
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2335 // Fallback to prop when attributes are not supported
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2336 if ( typeof elem.getAttribute === core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2337 return jQuery.prop( elem, name, value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2338 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2339
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2340 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2341
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2342 // All attributes are lowercase
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2343 // Grab necessary hook if one is defined
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2344 if ( notxml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2345 name = name.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2346 hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2347 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2348
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2349 if ( value !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2350
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2351 if ( value === null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2352 jQuery.removeAttr( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2353
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2354 } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2355 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2356
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2357 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2358 elem.setAttribute( name, value + "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2359 return value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2360 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2361
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2362 } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2363 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2364
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2365 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2366
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2367 // In IE9+, Flash objects don't have .getAttribute (#12945)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2368 // Support: IE9+
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2369 if ( typeof elem.getAttribute !== core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2370 ret = elem.getAttribute( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2371 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2372
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2373 // Non-existent attributes return null, we normalize to undefined
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2374 return ret == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2375 undefined :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2376 ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2377 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2378 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2379
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2380 removeAttr: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2381 var name, propName,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2382 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2383 attrNames = value && value.match( core_rnotwhite );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2384
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2385 if ( attrNames && elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2386 while ( (name = attrNames[i++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2387 propName = jQuery.propFix[ name ] || name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2388
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2389 // Boolean attributes get special treatment (#10870)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2390 if ( rboolean.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2391 // Set corresponding property to false for boolean attributes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2392 // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2393 if ( !getSetAttribute && ruseDefault.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2394 elem[ jQuery.camelCase( "default-" + name ) ] =
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2395 elem[ propName ] = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2396 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2397 elem[ propName ] = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2398 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2399
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2400 // See #9699 for explanation of this approach (setting first, then removal)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2401 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2402 jQuery.attr( elem, name, "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2403 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2404
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2405 elem.removeAttribute( getSetAttribute ? name : propName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2406 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2407 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2408 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2409
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2410 attrHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2411 type: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2412 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2413 if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2414 // Setting the type on a radio button after the value resets the value in IE6-9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2415 // Reset value to default in case type is set after value during creation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2416 var val = elem.value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2417 elem.setAttribute( "type", value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2418 if ( val ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2419 elem.value = val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2420 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2421 return value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2422 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2423 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2424 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2425 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2426
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2427 propFix: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2428 tabindex: "tabIndex",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2429 readonly: "readOnly",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2430 "for": "htmlFor",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2431 "class": "className",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2432 maxlength: "maxLength",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2433 cellspacing: "cellSpacing",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2434 cellpadding: "cellPadding",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2435 rowspan: "rowSpan",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2436 colspan: "colSpan",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2437 usemap: "useMap",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2438 frameborder: "frameBorder",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2439 contenteditable: "contentEditable"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2440 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2441
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2442 prop: function( elem, name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2443 var ret, hooks, notxml,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2444 nType = elem.nodeType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2445
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2446 // don't get/set properties on text, comment and attribute nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2447 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2448 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2449 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2450
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2451 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2452
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2453 if ( notxml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2454 // Fix name and attach hooks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2455 name = jQuery.propFix[ name ] || name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2456 hooks = jQuery.propHooks[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2457 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2458
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2459 if ( value !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2460 if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2461 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2462
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2463 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2464 return ( elem[ name ] = value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2465 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2466
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2467 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2468 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2469 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2470
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2471 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2472 return elem[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2473 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2474 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2475 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2476
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2477 propHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2478 tabIndex: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2479 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2480 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2481 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2482 var attributeNode = elem.getAttributeNode("tabindex");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2483
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2484 return attributeNode && attributeNode.specified ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2485 parseInt( attributeNode.value, 10 ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2486 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2487 0 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2488 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2489 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2490 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2491 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2492 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2493
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2494 // Hook for boolean attributes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2495 boolHook = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2496 get: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2497 var
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2498 // Use .prop to determine if this attribute is understood as boolean
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2499 prop = jQuery.prop( elem, name ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2500
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2501 // Fetch it accordingly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2502 attr = typeof prop === "boolean" && elem.getAttribute( name ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2503 detail = typeof prop === "boolean" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2504
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2505 getSetInput && getSetAttribute ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2506 attr != null :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2507 // oldIE fabricates an empty string for missing boolean attributes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2508 // and conflates checked/selected into attroperties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2509 ruseDefault.test( name ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2510 elem[ jQuery.camelCase( "default-" + name ) ] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2511 !!attr :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2512
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2513 // fetch an attribute node for properties not recognized as boolean
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2514 elem.getAttributeNode( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2515
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2516 return detail && detail.value !== false ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2517 name.toLowerCase() :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2518 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2519 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2520 set: function( elem, value, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2521 if ( value === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2522 // Remove boolean attributes when set to false
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2523 jQuery.removeAttr( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2524 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2525 // IE<8 needs the *property* name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2526 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2527
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2528 // Use defaultChecked and defaultSelected for oldIE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2529 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2530 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2531 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2532
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2533 return name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2534 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2535 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2536
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2537 // fix oldIE value attroperty
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2538 if ( !getSetInput || !getSetAttribute ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2539 jQuery.attrHooks.value = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2540 get: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2541 var ret = elem.getAttributeNode( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2542 return jQuery.nodeName( elem, "input" ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2543
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2544 // Ignore the value *property* by using defaultValue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2545 elem.defaultValue :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2546
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2547 ret && ret.specified ? ret.value : undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2548 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2549 set: function( elem, value, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2550 if ( jQuery.nodeName( elem, "input" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2551 // Does not return so that setAttribute is also used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2552 elem.defaultValue = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2553 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2554 // Use nodeHook if defined (#1954); otherwise setAttribute is fine
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2555 return nodeHook && nodeHook.set( elem, value, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2556 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2557 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2558 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2559 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2560
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2561 // IE6/7 do not support getting/setting some attributes with get/setAttribute
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2562 if ( !getSetAttribute ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2563
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2564 // Use this for any attribute in IE6/7
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2565 // This fixes almost every IE6/7 issue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2566 nodeHook = jQuery.valHooks.button = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2567 get: function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2568 var ret = elem.getAttributeNode( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2569 return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2570 ret.value :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2571 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2572 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2573 set: function( elem, value, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2574 // Set the existing or create a new attribute node
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2575 var ret = elem.getAttributeNode( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2576 if ( !ret ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2577 elem.setAttributeNode(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2578 (ret = elem.ownerDocument.createAttribute( name ))
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2579 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2580 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2581
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2582 ret.value = value += "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2583
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2584 // Break association with cloned elements by also using setAttribute (#9646)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2585 return name === "value" || value === elem.getAttribute( name ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2586 value :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2587 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2588 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2589 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2590
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2591 // Set contenteditable to false on removals(#10429)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2592 // Setting to empty string throws an error as an invalid value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2593 jQuery.attrHooks.contenteditable = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2594 get: nodeHook.get,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2595 set: function( elem, value, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2596 nodeHook.set( elem, value === "" ? false : value, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2597 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2598 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2599
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2600 // Set width and height to auto instead of 0 on empty string( Bug #8150 )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2601 // This is for removals
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2602 jQuery.each([ "width", "height" ], function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2603 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2604 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2605 if ( value === "" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2606 elem.setAttribute( name, "auto" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2607 return value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2608 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2609 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2610 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2611 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2612 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2613
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2614
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2615 // Some attributes require a special call on IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2616 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2617 if ( !jQuery.support.hrefNormalized ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2618 jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2619 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2620 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2621 var ret = elem.getAttribute( name, 2 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2622 return ret == null ? undefined : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2623 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2624 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2625 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2626
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2627 // href/src property should get the full normalized URL (#10299/#12915)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2628 jQuery.each([ "href", "src" ], function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2629 jQuery.propHooks[ name ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2630 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2631 return elem.getAttribute( name, 4 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2632 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2633 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2634 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2635 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2636
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2637 if ( !jQuery.support.style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2638 jQuery.attrHooks.style = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2639 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2640 // Return undefined in the case of empty string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2641 // Note: IE uppercases css property names, but if we were to .toLowerCase()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2642 // .cssText, that would destroy case senstitivity in URL's, like in "background"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2643 return elem.style.cssText || undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2644 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2645 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2646 return ( elem.style.cssText = value + "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2647 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2648 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2649 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2650
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2651 // Safari mis-reports the default selected property of an option
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2652 // Accessing the parent's selectedIndex property fixes it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2653 if ( !jQuery.support.optSelected ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2654 jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2655 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2656 var parent = elem.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2657
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2658 if ( parent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2659 parent.selectedIndex;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2660
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2661 // Make sure that it also works with optgroups, see #5701
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2662 if ( parent.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2663 parent.parentNode.selectedIndex;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2664 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2665 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2666 return null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2667 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2668 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2669 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2670
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2671 // IE6/7 call enctype encoding
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2672 if ( !jQuery.support.enctype ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2673 jQuery.propFix.enctype = "encoding";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2674 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2675
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2676 // Radios and checkboxes getter/setter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2677 if ( !jQuery.support.checkOn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2678 jQuery.each([ "radio", "checkbox" ], function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2679 jQuery.valHooks[ this ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2680 get: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2681 // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2682 return elem.getAttribute("value") === null ? "on" : elem.value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2683 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2684 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2685 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2686 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2687 jQuery.each([ "radio", "checkbox" ], function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2688 jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2689 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2690 if ( jQuery.isArray( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2691 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2692 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2693 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2694 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2695 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2696 var rformElems = /^(?:input|select|textarea)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2697 rkeyEvent = /^key/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2698 rmouseEvent = /^(?:mouse|contextmenu)|click/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2699 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2700 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2701
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2702 function returnTrue() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2703 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2704 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2705
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2706 function returnFalse() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2707 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2708 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2709
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2710 /*
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2711 * Helper functions for managing events -- not part of the public interface.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2712 * Props to Dean Edwards' addEvent library for many of the ideas.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2713 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2714 jQuery.event = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2715
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2716 global: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2717
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2718 add: function( elem, types, handler, data, selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2719 var tmp, events, t, handleObjIn,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2720 special, eventHandle, handleObj,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2721 handlers, type, namespaces, origType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2722 elemData = jQuery._data( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2723
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2724 // Don't attach events to noData or text/comment nodes (but allow plain objects)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2725 if ( !elemData ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2726 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2727 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2728
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2729 // Caller can pass in an object of custom data in lieu of the handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2730 if ( handler.handler ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2731 handleObjIn = handler;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2732 handler = handleObjIn.handler;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2733 selector = handleObjIn.selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2734 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2735
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2736 // Make sure that the handler has a unique ID, used to find/remove it later
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2737 if ( !handler.guid ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2738 handler.guid = jQuery.guid++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2739 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2740
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2741 // Init the element's event structure and main handler, if this is the first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2742 if ( !(events = elemData.events) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2743 events = elemData.events = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2744 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2745 if ( !(eventHandle = elemData.handle) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2746 eventHandle = elemData.handle = function( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2747 // Discard the second event of a jQuery.event.trigger() and
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2748 // when an event is called after a page has unloaded
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2749 return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2750 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2751 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2752 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2753 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2754 eventHandle.elem = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2755 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2756
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2757 // Handle multiple events separated by a space
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2758 // jQuery(...).bind("mouseover mouseout", fn);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2759 types = ( types || "" ).match( core_rnotwhite ) || [""];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2760 t = types.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2761 while ( t-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2762 tmp = rtypenamespace.exec( types[t] ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2763 type = origType = tmp[1];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2764 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2765
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2766 // If event changes its type, use the special event handlers for the changed type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2767 special = jQuery.event.special[ type ] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2768
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2769 // If selector defined, determine special event api type, otherwise given type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2770 type = ( selector ? special.delegateType : special.bindType ) || type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2771
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2772 // Update special based on newly reset type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2773 special = jQuery.event.special[ type ] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2774
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2775 // handleObj is passed to all event handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2776 handleObj = jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2777 type: type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2778 origType: origType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2779 data: data,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2780 handler: handler,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2781 guid: handler.guid,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2782 selector: selector,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2783 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2784 namespace: namespaces.join(".")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2785 }, handleObjIn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2786
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2787 // Init the event handler queue if we're the first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2788 if ( !(handlers = events[ type ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2789 handlers = events[ type ] = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2790 handlers.delegateCount = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2791
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2792 // Only use addEventListener/attachEvent if the special events handler returns false
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2793 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2794 // Bind the global event handler to the element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2795 if ( elem.addEventListener ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2796 elem.addEventListener( type, eventHandle, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2797
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2798 } else if ( elem.attachEvent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2799 elem.attachEvent( "on" + type, eventHandle );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2800 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2801 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2802 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2803
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2804 if ( special.add ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2805 special.add.call( elem, handleObj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2806
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2807 if ( !handleObj.handler.guid ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2808 handleObj.handler.guid = handler.guid;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2809 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2810 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2811
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2812 // Add to the element's handler list, delegates in front
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2813 if ( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2814 handlers.splice( handlers.delegateCount++, 0, handleObj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2815 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2816 handlers.push( handleObj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2817 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2818
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2819 // Keep track of which events have ever been used, for event optimization
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2820 jQuery.event.global[ type ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2821 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2823 // Nullify elem to prevent memory leaks in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2824 elem = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2825 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2826
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2827 // Detach an event or set of events from an element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2828 remove: function( elem, types, handler, selector, mappedTypes ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2829 var j, handleObj, tmp,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2830 origCount, t, events,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2831 special, handlers, type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2832 namespaces, origType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2833 elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2834
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2835 if ( !elemData || !(events = elemData.events) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2836 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2837 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2838
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2839 // Once for each type.namespace in types; type may be omitted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2840 types = ( types || "" ).match( core_rnotwhite ) || [""];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2841 t = types.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2842 while ( t-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2843 tmp = rtypenamespace.exec( types[t] ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2844 type = origType = tmp[1];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2845 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2846
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2847 // Unbind all events (on this namespace, if provided) for the element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2848 if ( !type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2849 for ( type in events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2850 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2851 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2852 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2853 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2854
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2855 special = jQuery.event.special[ type ] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2856 type = ( selector ? special.delegateType : special.bindType ) || type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2857 handlers = events[ type ] || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2858 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2859
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2860 // Remove matching events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2861 origCount = j = handlers.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2862 while ( j-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2863 handleObj = handlers[ j ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2864
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2865 if ( ( mappedTypes || origType === handleObj.origType ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2866 ( !handler || handler.guid === handleObj.guid ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2867 ( !tmp || tmp.test( handleObj.namespace ) ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2868 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2869 handlers.splice( j, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2870
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2871 if ( handleObj.selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2872 handlers.delegateCount--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2873 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2874 if ( special.remove ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2875 special.remove.call( elem, handleObj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2876 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2877 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2878 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2879
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2880 // Remove generic event handler if we removed something and no more handlers exist
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2881 // (avoids potential for endless recursion during removal of special event handlers)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2882 if ( origCount && !handlers.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2883 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2884 jQuery.removeEvent( elem, type, elemData.handle );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2885 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2886
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2887 delete events[ type ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2888 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2889 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2890
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2891 // Remove the expando if it's no longer used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2892 if ( jQuery.isEmptyObject( events ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2893 delete elemData.handle;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2894
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2895 // removeData also checks for emptiness and clears the expando if empty
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2896 // so use it instead of delete
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2897 jQuery._removeData( elem, "events" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2898 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2899 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2900
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2901 trigger: function( event, data, elem, onlyHandlers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2902 var handle, ontype, cur,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2903 bubbleType, special, tmp, i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2904 eventPath = [ elem || document ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2905 type = core_hasOwn.call( event, "type" ) ? event.type : event,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2906 namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2907
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2908 cur = tmp = elem = elem || document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2909
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2910 // Don't do events on text and comment nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2911 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2912 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2913 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2914
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2915 // focus/blur morphs to focusin/out; ensure we're not firing them right now
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2916 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2917 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2918 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2919
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2920 if ( type.indexOf(".") >= 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2921 // Namespaced trigger; create a regexp to match event type in handle()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2922 namespaces = type.split(".");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2923 type = namespaces.shift();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2924 namespaces.sort();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2925 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2926 ontype = type.indexOf(":") < 0 && "on" + type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2927
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2928 // Caller can pass in a jQuery.Event object, Object, or just an event type string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2929 event = event[ jQuery.expando ] ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2930 event :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2931 new jQuery.Event( type, typeof event === "object" && event );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2932
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2933 event.isTrigger = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2934 event.namespace = namespaces.join(".");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2935 event.namespace_re = event.namespace ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2936 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2937 null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2938
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2939 // Clean up the event in case it is being reused
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2940 event.result = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2941 if ( !event.target ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2942 event.target = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2943 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2944
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2945 // Clone any incoming data and prepend the event, creating the handler arg list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2946 data = data == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2947 [ event ] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2948 jQuery.makeArray( data, [ event ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2949
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2950 // Allow special events to draw outside the lines
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2951 special = jQuery.event.special[ type ] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2952 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2953 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2954 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2955
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2956 // Determine event propagation path in advance, per W3C events spec (#9951)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2957 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2958 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2959
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2960 bubbleType = special.delegateType || type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2961 if ( !rfocusMorph.test( bubbleType + type ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2962 cur = cur.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2963 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2964 for ( ; cur; cur = cur.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2965 eventPath.push( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2966 tmp = cur;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2967 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2968
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2969 // Only add window if we got to document (e.g., not plain obj or detached DOM)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2970 if ( tmp === (elem.ownerDocument || document) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2971 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2972 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2973 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2974
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2975 // Fire handlers on the event path
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2976 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2977 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2978
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2979 event.type = i > 1 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2980 bubbleType :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2981 special.bindType || type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2982
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2983 // jQuery handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2984 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2985 if ( handle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2986 handle.apply( cur, data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2987 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2988
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2989 // Native handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2990 handle = ontype && cur[ ontype ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2991 if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2992 event.preventDefault();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2993 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2994 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2995 event.type = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2996
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2997 // If nobody prevented the default action, do it now
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2998 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2999
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3000 if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3001 !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3002
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3003 // Call a native DOM method on the target with the same name name as the event.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3004 // Can't use an .isFunction() check here because IE6/7 fails that test.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3005 // Don't do default actions on window, that's where global variables be (#6170)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3006 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3007
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3008 // Don't re-trigger an onFOO event when we call its FOO() method
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3009 tmp = elem[ ontype ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3010
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3011 if ( tmp ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3012 elem[ ontype ] = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3013 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3014
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3015 // Prevent re-triggering of the same event, since we already bubbled it above
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3016 jQuery.event.triggered = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3017 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3018 elem[ type ]();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3019 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3020 // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3021 // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3022 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3023 jQuery.event.triggered = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3024
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3025 if ( tmp ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3026 elem[ ontype ] = tmp;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3027 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3028 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3029 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3030 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3031
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3032 return event.result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3033 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3034
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3035 dispatch: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3036
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3037 // Make a writable jQuery.Event from the native event object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3038 event = jQuery.event.fix( event );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3039
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3040 var i, ret, handleObj, matched, j,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3041 handlerQueue = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3042 args = core_slice.call( arguments ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3043 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3044 special = jQuery.event.special[ event.type ] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3045
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3046 // Use the fix-ed jQuery.Event rather than the (read-only) native event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3047 args[0] = event;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3048 event.delegateTarget = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3049
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3050 // Call the preDispatch hook for the mapped type, and let it bail if desired
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3051 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3052 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3053 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3054
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3055 // Determine handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3056 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3057
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3058 // Run delegates first; they may want to stop propagation beneath us
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3059 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3060 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3061 event.currentTarget = matched.elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3062
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3063 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3064 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3065
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3066 // Triggered event must either 1) have no namespace, or
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3067 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3068 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3069
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3070 event.handleObj = handleObj;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3071 event.data = handleObj.data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3072
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3073 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3074 .apply( matched.elem, args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3075
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3076 if ( ret !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3077 if ( (event.result = ret) === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3078 event.preventDefault();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3079 event.stopPropagation();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3080 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3081 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3082 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3083 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3084 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3085
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3086 // Call the postDispatch hook for the mapped type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3087 if ( special.postDispatch ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3088 special.postDispatch.call( this, event );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3089 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3090
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3091 return event.result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3092 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3093
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3094 handlers: function( event, handlers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3095 var sel, handleObj, matches, i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3096 handlerQueue = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3097 delegateCount = handlers.delegateCount,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3098 cur = event.target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3099
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3100 // Find delegate handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3101 // Black-hole SVG <use> instance trees (#13180)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3102 // Avoid non-left-click bubbling in Firefox (#3861)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3103 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3104
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3105 for ( ; cur != this; cur = cur.parentNode || this ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3106
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3107 // Don't check non-elements (#13208)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3108 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3109 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3110 matches = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3111 for ( i = 0; i < delegateCount; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3112 handleObj = handlers[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3113
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3114 // Don't conflict with Object.prototype properties (#13203)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3115 sel = handleObj.selector + " ";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3116
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3117 if ( matches[ sel ] === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3118 matches[ sel ] = handleObj.needsContext ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3119 jQuery( sel, this ).index( cur ) >= 0 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3120 jQuery.find( sel, this, null, [ cur ] ).length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3121 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3122 if ( matches[ sel ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3123 matches.push( handleObj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3124 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3125 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3126 if ( matches.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3127 handlerQueue.push({ elem: cur, handlers: matches });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3128 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3129 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3130 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3131 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3132
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3133 // Add the remaining (directly-bound) handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3134 if ( delegateCount < handlers.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3135 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3136 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3137
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3138 return handlerQueue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3139 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3140
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3141 fix: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3142 if ( event[ jQuery.expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3143 return event;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3144 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3145
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3146 // Create a writable copy of the event object and normalize some properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3147 var i, prop, copy,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3148 type = event.type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3149 originalEvent = event,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3150 fixHook = this.fixHooks[ type ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3151
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3152 if ( !fixHook ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3153 this.fixHooks[ type ] = fixHook =
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3154 rmouseEvent.test( type ) ? this.mouseHooks :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3155 rkeyEvent.test( type ) ? this.keyHooks :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3156 {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3157 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3158 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3159
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3160 event = new jQuery.Event( originalEvent );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3161
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3162 i = copy.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3163 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3164 prop = copy[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3165 event[ prop ] = originalEvent[ prop ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3166 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3167
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3168 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3169 // Fix target property (#1925)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3170 if ( !event.target ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3171 event.target = originalEvent.srcElement || document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3172 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3173
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3174 // Support: Chrome 23+, Safari?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3175 // Target should not be a text node (#504, #13143)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3176 if ( event.target.nodeType === 3 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3177 event.target = event.target.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3178 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3179
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3180 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3181 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3182 event.metaKey = !!event.metaKey;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3183
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3184 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3185 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3186
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3187 // Includes some event props shared by KeyEvent and MouseEvent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3188 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3189
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3190 fixHooks: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3191
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3192 keyHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3193 props: "char charCode key keyCode".split(" "),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3194 filter: function( event, original ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3195
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3196 // Add which for key events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3197 if ( event.which == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3198 event.which = original.charCode != null ? original.charCode : original.keyCode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3199 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3200
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3201 return event;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3202 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3203 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3204
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3205 mouseHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3206 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3207 filter: function( event, original ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3208 var body, eventDoc, doc,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3209 button = original.button,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3210 fromElement = original.fromElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3211
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3212 // Calculate pageX/Y if missing and clientX/Y available
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3213 if ( event.pageX == null && original.clientX != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3214 eventDoc = event.target.ownerDocument || document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3215 doc = eventDoc.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3216 body = eventDoc.body;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3217
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3218 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3219 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3220 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3221
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3222 // Add relatedTarget, if necessary
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3223 if ( !event.relatedTarget && fromElement ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3224 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3225 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3226
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3227 // Add which for click: 1 === left; 2 === middle; 3 === right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3228 // Note: button is not normalized, so don't use it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3229 if ( !event.which && button !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3230 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3231 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3232
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3233 return event;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3234 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3235 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3236
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3237 special: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3238 load: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3239 // Prevent triggered image.load events from bubbling to window.load
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3240 noBubble: true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3241 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3242 click: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3243 // For checkbox, fire native event so checked state will be right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3244 trigger: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3245 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3246 this.click();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3247 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3248 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3250 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3251 focus: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3252 // Fire native event if possible so blur/focus sequence is correct
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3253 trigger: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3254 if ( this !== document.activeElement && this.focus ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3255 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3256 this.focus();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3257 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3258 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3259 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3260 // If we error on focus to hidden element (#1486, #12518),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3261 // let .trigger() run the handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3262 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3263 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3264 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3265 delegateType: "focusin"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3266 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3267 blur: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3268 trigger: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3269 if ( this === document.activeElement && this.blur ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3270 this.blur();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3271 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3272 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3273 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3274 delegateType: "focusout"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3275 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3276
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3277 beforeunload: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3278 postDispatch: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3279
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3280 // Even when returnValue equals to undefined Firefox will still show alert
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3281 if ( event.result !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3282 event.originalEvent.returnValue = event.result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3283 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3284 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3285 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3286 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3287
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3288 simulate: function( type, elem, event, bubble ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3289 // Piggyback on a donor event to simulate a different one.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3290 // Fake originalEvent to avoid donor's stopPropagation, but if the
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3291 // simulated event prevents default then we do the same on the donor.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3292 var e = jQuery.extend(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3293 new jQuery.Event(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3294 event,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3295 { type: type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3296 isSimulated: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3297 originalEvent: {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3298 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3299 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3300 if ( bubble ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3301 jQuery.event.trigger( e, null, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3302 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3303 jQuery.event.dispatch.call( elem, e );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3304 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3305 if ( e.isDefaultPrevented() ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3306 event.preventDefault();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3307 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3308 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3309 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3310
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3311 jQuery.removeEvent = document.removeEventListener ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3312 function( elem, type, handle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3313 if ( elem.removeEventListener ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3314 elem.removeEventListener( type, handle, false );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3315 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3316 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3317 function( elem, type, handle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3318 var name = "on" + type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3319
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3320 if ( elem.detachEvent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3321
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3322 // #8545, #7054, preventing memory leaks for custom events in IE6-8
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3323 // detachEvent needed property on element, by name of that event, to properly expose it to GC
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3324 if ( typeof elem[ name ] === core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3325 elem[ name ] = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3326 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3327
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3328 elem.detachEvent( name, handle );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3329 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3330 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3331
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3332 jQuery.Event = function( src, props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3333 // Allow instantiation without the 'new' keyword
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3334 if ( !(this instanceof jQuery.Event) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3335 return new jQuery.Event( src, props );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3336 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3337
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3338 // Event object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3339 if ( src && src.type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3340 this.originalEvent = src;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3341 this.type = src.type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3342
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3343 // Events bubbling up the document may have been marked as prevented
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3344 // by a handler lower down the tree; reflect the correct value.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3345 this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3346 src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3347
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3348 // Event type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3349 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3350 this.type = src;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3351 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3352
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3353 // Put explicitly provided properties onto the event object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3354 if ( props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3355 jQuery.extend( this, props );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3356 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3357
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3358 // Create a timestamp if incoming event doesn't have one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3359 this.timeStamp = src && src.timeStamp || jQuery.now();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3360
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3361 // Mark it as fixed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3362 this[ jQuery.expando ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3363 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3364
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3365 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3366 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3367 jQuery.Event.prototype = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3368 isDefaultPrevented: returnFalse,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3369 isPropagationStopped: returnFalse,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3370 isImmediatePropagationStopped: returnFalse,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3371
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3372 preventDefault: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3373 var e = this.originalEvent;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3374
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3375 this.isDefaultPrevented = returnTrue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3376 if ( !e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3377 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3378 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3379
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3380 // If preventDefault exists, run it on the original event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3381 if ( e.preventDefault ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3382 e.preventDefault();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3383
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3384 // Support: IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3385 // Otherwise set the returnValue property of the original event to false
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3386 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3387 e.returnValue = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3388 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3389 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3390 stopPropagation: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3391 var e = this.originalEvent;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3392
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3393 this.isPropagationStopped = returnTrue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3394 if ( !e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3395 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3396 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3397 // If stopPropagation exists, run it on the original event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3398 if ( e.stopPropagation ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3399 e.stopPropagation();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3400 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3401
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3402 // Support: IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3403 // Set the cancelBubble property of the original event to true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3404 e.cancelBubble = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3405 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3406 stopImmediatePropagation: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3407 this.isImmediatePropagationStopped = returnTrue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3408 this.stopPropagation();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3409 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3410 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3411
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3412 // Create mouseenter/leave events using mouseover/out and event-time checks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3413 jQuery.each({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3414 mouseenter: "mouseover",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3415 mouseleave: "mouseout"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3416 }, function( orig, fix ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3417 jQuery.event.special[ orig ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3418 delegateType: fix,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3419 bindType: fix,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3420
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3421 handle: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3422 var ret,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3423 target = this,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3424 related = event.relatedTarget,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3425 handleObj = event.handleObj;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3426
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3427 // For mousenter/leave call the handler if related is outside the target.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3428 // NB: No relatedTarget if the mouse left/entered the browser window
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3429 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3430 event.type = handleObj.origType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3431 ret = handleObj.handler.apply( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3432 event.type = fix;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3433 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3434 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3435 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3436 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3437 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3438
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3439 // IE submit delegation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3440 if ( !jQuery.support.submitBubbles ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3441
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3442 jQuery.event.special.submit = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3443 setup: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3444 // Only need this for delegated form submit events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3445 if ( jQuery.nodeName( this, "form" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3446 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3447 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3448
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3449 // Lazy-add a submit handler when a descendant form may potentially be submitted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3450 jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3451 // Node name check avoids a VML-related crash in IE (#9807)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3452 var elem = e.target,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3453 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3454 if ( form && !jQuery._data( form, "submitBubbles" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3455 jQuery.event.add( form, "submit._submit", function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3456 event._submit_bubble = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3457 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3458 jQuery._data( form, "submitBubbles", true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3459 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3460 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3461 // return undefined since we don't need an event listener
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3462 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3463
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3464 postDispatch: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3465 // If form was submitted by the user, bubble the event up the tree
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3466 if ( event._submit_bubble ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3467 delete event._submit_bubble;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3468 if ( this.parentNode && !event.isTrigger ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3469 jQuery.event.simulate( "submit", this.parentNode, event, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3470 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3471 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3472 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3473
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3474 teardown: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3475 // Only need this for delegated form submit events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3476 if ( jQuery.nodeName( this, "form" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3477 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3478 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3479
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3480 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3481 jQuery.event.remove( this, "._submit" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3482 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3483 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3484 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3485
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3486 // IE change delegation and checkbox/radio fix
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3487 if ( !jQuery.support.changeBubbles ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3488
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3489 jQuery.event.special.change = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3490
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3491 setup: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3492
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3493 if ( rformElems.test( this.nodeName ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3494 // IE doesn't fire change on a check/radio until blur; trigger it on click
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3495 // after a propertychange. Eat the blur-change in special.change.handle.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3496 // This still fires onchange a second time for check/radio after blur.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3497 if ( this.type === "checkbox" || this.type === "radio" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3498 jQuery.event.add( this, "propertychange._change", function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3499 if ( event.originalEvent.propertyName === "checked" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3500 this._just_changed = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3501 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3502 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3503 jQuery.event.add( this, "click._change", function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3504 if ( this._just_changed && !event.isTrigger ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3505 this._just_changed = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3506 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3507 // Allow triggered, simulated change events (#11500)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3508 jQuery.event.simulate( "change", this, event, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3509 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3510 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3511 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3512 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3513 // Delegated event; lazy-add a change handler on descendant inputs
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3514 jQuery.event.add( this, "beforeactivate._change", function( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3515 var elem = e.target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3516
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3517 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3518 jQuery.event.add( elem, "change._change", function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3519 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3520 jQuery.event.simulate( "change", this.parentNode, event, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3521 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3522 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3523 jQuery._data( elem, "changeBubbles", true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3524 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3525 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3526 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3527
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3528 handle: function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3529 var elem = event.target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3530
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3531 // Swallow native change events from checkbox/radio, we already triggered them above
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3532 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3533 return event.handleObj.handler.apply( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3534 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3535 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3536
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3537 teardown: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3538 jQuery.event.remove( this, "._change" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3539
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3540 return !rformElems.test( this.nodeName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3541 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3542 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3543 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3544
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3545 // Create "bubbling" focus and blur events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3546 if ( !jQuery.support.focusinBubbles ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3547 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3548
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3549 // Attach a single capturing handler while someone wants focusin/focusout
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3550 var attaches = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3551 handler = function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3552 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3553 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3554
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3555 jQuery.event.special[ fix ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3556 setup: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3557 if ( attaches++ === 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3558 document.addEventListener( orig, handler, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3559 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3560 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3561 teardown: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3562 if ( --attaches === 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3563 document.removeEventListener( orig, handler, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3564 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3565 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3566 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3567 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3568 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3569
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3570 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3571
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3572 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3573 var type, origFn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3574
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3575 // Types can be a map of types/handlers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3576 if ( typeof types === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3577 // ( types-Object, selector, data )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3578 if ( typeof selector !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3579 // ( types-Object, data )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3580 data = data || selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3581 selector = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3582 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3583 for ( type in types ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3584 this.on( type, selector, data, types[ type ], one );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3585 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3586 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3587 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3588
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3589 if ( data == null && fn == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3590 // ( types, fn )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3591 fn = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3592 data = selector = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3593 } else if ( fn == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3594 if ( typeof selector === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3595 // ( types, selector, fn )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3596 fn = data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3597 data = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3598 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3599 // ( types, data, fn )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3600 fn = data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3601 data = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3602 selector = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3603 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3604 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3605 if ( fn === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3606 fn = returnFalse;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3607 } else if ( !fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3608 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3609 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3610
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3611 if ( one === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3612 origFn = fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3613 fn = function( event ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3614 // Can use an empty set, since event contains the info
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3615 jQuery().off( event );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3616 return origFn.apply( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3617 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3618 // Use same guid so caller can remove using origFn
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3619 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3620 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3621 return this.each( function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3622 jQuery.event.add( this, types, fn, data, selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3623 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3624 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3625 one: function( types, selector, data, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3626 return this.on( types, selector, data, fn, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3627 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3628 off: function( types, selector, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3629 var handleObj, type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3630 if ( types && types.preventDefault && types.handleObj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3631 // ( event ) dispatched jQuery.Event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3632 handleObj = types.handleObj;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3633 jQuery( types.delegateTarget ).off(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3634 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3635 handleObj.selector,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3636 handleObj.handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3637 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3638 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3639 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3640 if ( typeof types === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3641 // ( types-object [, selector] )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3642 for ( type in types ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3643 this.off( type, selector, types[ type ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3644 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3645 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3646 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3647 if ( selector === false || typeof selector === "function" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3648 // ( types [, fn] )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3649 fn = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3650 selector = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3651 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3652 if ( fn === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3653 fn = returnFalse;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3654 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3655 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3656 jQuery.event.remove( this, types, fn, selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3657 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3658 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3659
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3660 bind: function( types, data, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3661 return this.on( types, null, data, fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3662 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3663 unbind: function( types, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3664 return this.off( types, null, fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3665 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3666
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3667 delegate: function( selector, types, data, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3668 return this.on( types, selector, data, fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3669 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3670 undelegate: function( selector, types, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3671 // ( namespace ) or ( selector, types [, fn] )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3672 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3673 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3674
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3675 trigger: function( type, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3676 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3677 jQuery.event.trigger( type, data, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3678 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3679 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3680 triggerHandler: function( type, data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3681 var elem = this[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3682 if ( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3683 return jQuery.event.trigger( type, data, elem, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3684 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3685 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3686 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3687 /*!
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3688 * Sizzle CSS Selector Engine
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3689 * Copyright 2012 jQuery Foundation and other contributors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3690 * Released under the MIT license
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3691 * http://sizzlejs.com/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3692 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3693 (function( window, undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3694
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3695 var i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3696 cachedruns,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3697 Expr,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3698 getText,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3699 isXML,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3700 compile,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3701 hasDuplicate,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3702 outermostContext,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3703
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3704 // Local document vars
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3705 setDocument,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3706 document,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3707 docElem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3708 documentIsXML,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3709 rbuggyQSA,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3710 rbuggyMatches,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3711 matches,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3712 contains,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3713 sortOrder,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3714
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3715 // Instance-specific data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3716 expando = "sizzle" + -(new Date()),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3717 preferredDoc = window.document,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3718 support = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3719 dirruns = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3720 done = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3721 classCache = createCache(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3722 tokenCache = createCache(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3723 compilerCache = createCache(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3724
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3725 // General-purpose constants
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3726 strundefined = typeof undefined,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3727 MAX_NEGATIVE = 1 << 31,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3728
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3729 // Array methods
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3730 arr = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3731 pop = arr.pop,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3732 push = arr.push,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3733 slice = arr.slice,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3734 // Use a stripped-down indexOf if we can't use a native one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3735 indexOf = arr.indexOf || function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3736 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3737 len = this.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3738 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3739 if ( this[i] === elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3740 return i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3741 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3742 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3743 return -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3744 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3745
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3746
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3747 // Regular expressions
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3748
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3749 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3750 whitespace = "[\\x20\\t\\r\\n\\f]",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3751 // http://www.w3.org/TR/css3-syntax/#characters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3752 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3753
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3754 // Loosely modeled on CSS identifier characters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3755 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3756 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3757 identifier = characterEncoding.replace( "w", "w#" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3758
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3759 // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3760 operators = "([*^$|!~]?=)",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3761 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3762 "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3763
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3764 // Prefer arguments quoted,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3765 // then not containing pseudos/brackets,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3766 // then attribute selectors/non-parenthetical expressions,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3767 // then anything else
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3768 // These preferences are here to reduce the number of selectors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3769 // needing tokenize in the PSEUDO preFilter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3770 pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3771
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3772 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3773 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3774
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3775 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3776 rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3777 rpseudo = new RegExp( pseudos ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3778 ridentifier = new RegExp( "^" + identifier + "$" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3779
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3780 matchExpr = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3781 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3782 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3783 "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3784 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3785 "ATTR": new RegExp( "^" + attributes ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3786 "PSEUDO": new RegExp( "^" + pseudos ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3787 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3788 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3789 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3790 // For use in libraries implementing .is()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3791 // We use this for POS matching in `select`
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3792 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3793 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3794 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3795
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3796 rsibling = /[\x20\t\r\n\f]*[+~]/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3797
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3798 rnative = /^[^{]+\{\s*\[native code/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3799
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3800 // Easily-parseable/retrievable ID or TAG or CLASS selectors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3801 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3802
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3803 rinputs = /^(?:input|select|textarea|button)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3804 rheader = /^h\d$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3805
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3806 rescape = /'|\\/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3807 rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3808
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3809 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3810 runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3811 funescape = function( _, escaped ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3812 var high = "0x" + escaped - 0x10000;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3813 // NaN means non-codepoint
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3814 return high !== high ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3815 escaped :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3816 // BMP codepoint
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3817 high < 0 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3818 String.fromCharCode( high + 0x10000 ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3819 // Supplemental Plane codepoint (surrogate pair)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3820 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3821 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3823 // Use a stripped-down slice if we can't use a native one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3824 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3825 slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3826 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3827 slice = function( i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3828 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3829 results = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3830 while ( (elem = this[i++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3831 results.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3832 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3833 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3834 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3835 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3836
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3837 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3838 * For feature detection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3839 * @param {Function} fn The function to test for native support
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3840 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3841 function isNative( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3842 return rnative.test( fn + "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3843 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3844
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3845 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3846 * Create key-value caches of limited size
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3847 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3848 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3849 * deleting the oldest entry
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3850 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3851 function createCache() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3852 var cache,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3853 keys = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3854
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3855 return (cache = function( key, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3856 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3857 if ( keys.push( key += " " ) > Expr.cacheLength ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3858 // Only keep the most recent entries
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3859 delete cache[ keys.shift() ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3860 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3861 return (cache[ key ] = value);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3862 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3863 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3864
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3865 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3866 * Mark a function for special use by Sizzle
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3867 * @param {Function} fn The function to mark
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3868 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3869 function markFunction( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3870 fn[ expando ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3871 return fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3872 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3873
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3874 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3875 * Support testing using an element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3876 * @param {Function} fn Passed the created div and expects a boolean result
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3877 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3878 function assert( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3879 var div = document.createElement("div");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3880
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3881 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3882 return fn( div );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3883 } catch (e) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3884 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3885 } finally {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3886 // release memory in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3887 div = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3888 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3889 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3890
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3891 function Sizzle( selector, context, results, seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3892 var match, elem, m, nodeType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3893 // QSA vars
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3894 i, groups, old, nid, newContext, newSelector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3895
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3896 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3897 setDocument( context );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3898 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3899
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3900 context = context || document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3901 results = results || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3902
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3903 if ( !selector || typeof selector !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3904 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3905 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3906
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3907 if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3908 return [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3909 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3910
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3911 if ( !documentIsXML && !seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3912
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3913 // Shortcuts
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3914 if ( (match = rquickExpr.exec( selector )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3915 // Speed-up: Sizzle("#ID")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3916 if ( (m = match[1]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3917 if ( nodeType === 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3918 elem = context.getElementById( m );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3919 // Check parentNode to catch when Blackberry 4.6 returns
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3920 // nodes that are no longer in the document #6963
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3921 if ( elem && elem.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3922 // Handle the case where IE, Opera, and Webkit return items
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3923 // by name instead of ID
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3924 if ( elem.id === m ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3925 results.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3926 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3927 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3928 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3929 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3930 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3931 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3932 // Context is not a document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3933 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3934 contains( context, elem ) && elem.id === m ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3935 results.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3936 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3937 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3938 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3939
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3940 // Speed-up: Sizzle("TAG")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3941 } else if ( match[2] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3942 push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3943 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3944
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3945 // Speed-up: Sizzle(".CLASS")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3946 } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3947 push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3948 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3949 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3950 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3951
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3952 // QSA path
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3953 if ( support.qsa && !rbuggyQSA.test(selector) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3954 old = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3955 nid = expando;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3956 newContext = context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3957 newSelector = nodeType === 9 && selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3958
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3959 // qSA works strangely on Element-rooted queries
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3960 // We can work around this by specifying an extra ID on the root
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3961 // and working up from there (Thanks to Andrew Dupont for the technique)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3962 // IE 8 doesn't work on object elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3963 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3964 groups = tokenize( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3965
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3966 if ( (old = context.getAttribute("id")) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3967 nid = old.replace( rescape, "\\$&" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3968 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3969 context.setAttribute( "id", nid );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3970 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3971 nid = "[id='" + nid + "'] ";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3972
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3973 i = groups.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3974 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3975 groups[i] = nid + toSelector( groups[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3976 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3977 newContext = rsibling.test( selector ) && context.parentNode || context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3978 newSelector = groups.join(",");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3979 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3980
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3981 if ( newSelector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3982 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3983 push.apply( results, slice.call( newContext.querySelectorAll(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3984 newSelector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3985 ), 0 ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3986 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3987 } catch(qsaError) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3988 } finally {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3989 if ( !old ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3990 context.removeAttribute("id");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3991 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3992 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3993 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3994 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3995 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3996
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3997 // All others
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3998 return select( selector.replace( rtrim, "$1" ), context, results, seed );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3999 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4000
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4001 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4002 * Detect xml
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4003 * @param {Element|Object} elem An element or a document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4004 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4005 isXML = Sizzle.isXML = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4006 // documentElement is verified for cases where it doesn't yet exist
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4007 // (such as loading iframes in IE - #4833)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4008 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4009 return documentElement ? documentElement.nodeName !== "HTML" : false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4010 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4011
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4012 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4013 * Sets document-related variables once based on the current document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4014 * @param {Element|Object} [doc] An element or document object to use to set the document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4015 * @returns {Object} Returns the current document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4016 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4017 setDocument = Sizzle.setDocument = function( node ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4018 var doc = node ? node.ownerDocument || node : preferredDoc;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4019
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4020 // If no document and documentElement is available, return
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4021 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4022 return document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4023 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4024
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4025 // Set our document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4026 document = doc;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4027 docElem = doc.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4028
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4029 // Support tests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4030 documentIsXML = isXML( doc );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4031
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4032 // Check if getElementsByTagName("*") returns only elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4033 support.tagNameNoComments = assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4034 div.appendChild( doc.createComment("") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4035 return !div.getElementsByTagName("*").length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4036 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4037
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4038 // Check if attributes should be retrieved by attribute nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4039 support.attributes = assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4040 div.innerHTML = "<select></select>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4041 var type = typeof div.lastChild.getAttribute("multiple");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4042 // IE8 returns a string for some attributes even when not present
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4043 return type !== "boolean" && type !== "string";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4044 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4045
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4046 // Check if getElementsByClassName can be trusted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4047 support.getByClassName = assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4048 // Opera can't find a second classname (in 9.6)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4049 div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4050 if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4051 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4052 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4053
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4054 // Safari 3.2 caches class attributes and doesn't catch changes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4055 div.lastChild.className = "e";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4056 return div.getElementsByClassName("e").length === 2;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4057 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4058
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4059 // Check if getElementById returns elements by name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4060 // Check if getElementsByName privileges form controls or returns elements by ID
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4061 support.getByName = assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4062 // Inject content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4063 div.id = expando + 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4064 div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4065 docElem.insertBefore( div, docElem.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4066
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4067 // Test
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4068 var pass = doc.getElementsByName &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4069 // buggy browsers will return fewer than the correct 2
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4070 doc.getElementsByName( expando ).length === 2 +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4071 // buggy browsers will return more than the correct 0
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4072 doc.getElementsByName( expando + 0 ).length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4073 support.getIdNotName = !doc.getElementById( expando );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4074
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4075 // Cleanup
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4076 docElem.removeChild( div );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4077
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4078 return pass;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4079 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4080
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4081 // IE6/7 return modified attributes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4082 Expr.attrHandle = assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4083 div.innerHTML = "<a href='#'></a>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4084 return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4085 div.firstChild.getAttribute("href") === "#";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4086 }) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4087 {} :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4088 {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4089 "href": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4090 return elem.getAttribute( "href", 2 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4091 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4092 "type": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4093 return elem.getAttribute("type");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4094 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4095 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4096
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4097 // ID find and filter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4098 if ( support.getIdNotName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4099 Expr.find["ID"] = function( id, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4100 if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4101 var m = context.getElementById( id );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4102 // Check parentNode to catch when Blackberry 4.6 returns
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4103 // nodes that are no longer in the document #6963
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4104 return m && m.parentNode ? [m] : [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4105 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4106 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4107 Expr.filter["ID"] = function( id ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4108 var attrId = id.replace( runescape, funescape );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4109 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4110 return elem.getAttribute("id") === attrId;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4111 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4112 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4113 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4114 Expr.find["ID"] = function( id, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4115 if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4116 var m = context.getElementById( id );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4117
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4118 return m ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4119 m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4120 [m] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4121 undefined :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4122 [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4123 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4124 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4125 Expr.filter["ID"] = function( id ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4126 var attrId = id.replace( runescape, funescape );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4127 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4128 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4129 return node && node.value === attrId;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4130 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4131 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4132 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4133
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4134 // Tag
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4135 Expr.find["TAG"] = support.tagNameNoComments ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4136 function( tag, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4137 if ( typeof context.getElementsByTagName !== strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4138 return context.getElementsByTagName( tag );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4139 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4140 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4141 function( tag, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4142 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4143 tmp = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4144 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4145 results = context.getElementsByTagName( tag );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4146
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4147 // Filter out possible comments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4148 if ( tag === "*" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4149 while ( (elem = results[i++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4150 if ( elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4151 tmp.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4152 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4153 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4154
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4155 return tmp;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4156 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4157 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4158 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4159
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4160 // Name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4161 Expr.find["NAME"] = support.getByName && function( tag, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4162 if ( typeof context.getElementsByName !== strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4163 return context.getElementsByName( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4164 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4165 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4166
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4167 // Class
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4168 Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4169 if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4170 return context.getElementsByClassName( className );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4171 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4172 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4173
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4174 // QSA and matchesSelector support
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4175
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4176 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4177 rbuggyMatches = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4178
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4179 // qSa(:focus) reports false when true (Chrome 21),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4180 // no need to also add to buggyMatches since matches checks buggyQSA
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4181 // A support test would require too much code (would include document ready)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4182 rbuggyQSA = [ ":focus" ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4183
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4184 if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4185 // Build QSA regex
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4186 // Regex strategy adopted from Diego Perini
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4187 assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4188 // Select is set to empty string on purpose
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4189 // This is to test IE's treatment of not explictly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4190 // setting a boolean content attribute,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4191 // since its presence should be enough
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4192 // http://bugs.jquery.com/ticket/12359
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4193 div.innerHTML = "<select><option selected=''></option></select>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4194
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4195 // IE8 - Some boolean attributes are not treated correctly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4196 if ( !div.querySelectorAll("[selected]").length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4197 rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4198 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4199
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4200 // Webkit/Opera - :checked should return selected option elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4201 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4202 // IE8 throws error here and will not see later tests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4203 if ( !div.querySelectorAll(":checked").length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4204 rbuggyQSA.push(":checked");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4205 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4206 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4207
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4208 assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4209
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4210 // Opera 10-12/IE8 - ^= $= *= and empty values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4211 // Should not select anything
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4212 div.innerHTML = "<input type='hidden' i=''/>";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4213 if ( div.querySelectorAll("[i^='']").length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4214 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4215 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4216
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4217 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4218 // IE8 throws error here and will not see later tests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4219 if ( !div.querySelectorAll(":enabled").length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4220 rbuggyQSA.push( ":enabled", ":disabled" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4221 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4222
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4223 // Opera 10-11 does not throw on post-comma invalid pseudos
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4224 div.querySelectorAll("*,:x");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4225 rbuggyQSA.push(",.*:");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4226 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4227 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4228
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4229 if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4230 docElem.mozMatchesSelector ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4231 docElem.webkitMatchesSelector ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4232 docElem.oMatchesSelector ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4233 docElem.msMatchesSelector) )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4234
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4235 assert(function( div ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4236 // Check to see if it's possible to do matchesSelector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4237 // on a disconnected node (IE 9)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4238 support.disconnectedMatch = matches.call( div, "div" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4239
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4240 // This should fail with an exception
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4241 // Gecko does not error, returns false instead
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4242 matches.call( div, "[s!='']:x" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4243 rbuggyMatches.push( "!=", pseudos );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4244 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4245 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4246
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4247 rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4248 rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4249
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4250 // Element contains another
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4251 // Purposefully does not implement inclusive descendent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4252 // As in, an element does not contain itself
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4253 contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4254 function( a, b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4255 var adown = a.nodeType === 9 ? a.documentElement : a,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4256 bup = b && b.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4257 return a === bup || !!( bup && bup.nodeType === 1 && (
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4258 adown.contains ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4259 adown.contains( bup ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4260 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4261 ));
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4262 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4263 function( a, b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4264 if ( b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4265 while ( (b = b.parentNode) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4266 if ( b === a ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4267 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4268 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4269 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4270 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4271 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4272 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4273
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4274 // Document order sorting
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4275 sortOrder = docElem.compareDocumentPosition ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4276 function( a, b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4277 var compare;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4278
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4279 if ( a === b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4280 hasDuplicate = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4281 return 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4282 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4283
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4284 if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4285 if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4286 if ( a === doc || contains( preferredDoc, a ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4287 return -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4288 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4289 if ( b === doc || contains( preferredDoc, b ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4290 return 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4291 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4292 return 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4293 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4294 return compare & 4 ? -1 : 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4295 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4296
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4297 return a.compareDocumentPosition ? -1 : 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4298 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4299 function( a, b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4300 var cur,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4301 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4302 aup = a.parentNode,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4303 bup = b.parentNode,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4304 ap = [ a ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4305 bp = [ b ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4306
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4307 // Exit early if the nodes are identical
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4308 if ( a === b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4309 hasDuplicate = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4310 return 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4311
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4312 // Parentless nodes are either documents or disconnected
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4313 } else if ( !aup || !bup ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4314 return a === doc ? -1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4315 b === doc ? 1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4316 aup ? -1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4317 bup ? 1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4318 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4319
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4320 // If the nodes are siblings, we can do a quick check
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4321 } else if ( aup === bup ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4322 return siblingCheck( a, b );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4323 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4324
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4325 // Otherwise we need full lists of their ancestors for comparison
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4326 cur = a;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4327 while ( (cur = cur.parentNode) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4328 ap.unshift( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4329 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4330 cur = b;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4331 while ( (cur = cur.parentNode) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4332 bp.unshift( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4333 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4334
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4335 // Walk down the tree looking for a discrepancy
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4336 while ( ap[i] === bp[i] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4337 i++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4338 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4339
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4340 return i ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4341 // Do a sibling check if the nodes have a common ancestor
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4342 siblingCheck( ap[i], bp[i] ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4343
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4344 // Otherwise nodes in our document sort first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4345 ap[i] === preferredDoc ? -1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4346 bp[i] === preferredDoc ? 1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4347 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4348 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4349
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4350 // Always assume the presence of duplicates if sort doesn't
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4351 // pass them to our comparison function (as in Google Chrome).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4352 hasDuplicate = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4353 [0, 0].sort( sortOrder );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4354 support.detectDuplicates = hasDuplicate;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4355
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4356 return document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4357 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4358
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4359 Sizzle.matches = function( expr, elements ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4360 return Sizzle( expr, null, null, elements );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4361 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4362
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4363 Sizzle.matchesSelector = function( elem, expr ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4364 // Set document vars if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4365 if ( ( elem.ownerDocument || elem ) !== document ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4366 setDocument( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4367 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4368
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4369 // Make sure that attribute selectors are quoted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4370 expr = expr.replace( rattributeQuotes, "='$1']" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4371
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4372 // rbuggyQSA always contains :focus, so no need for an existence check
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4373 if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4374 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4375 var ret = matches.call( elem, expr );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4376
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4377 // IE 9's matchesSelector returns false on disconnected nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4378 if ( ret || support.disconnectedMatch ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4379 // As well, disconnected nodes are said to be in a document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4380 // fragment in IE 9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4381 elem.document && elem.document.nodeType !== 11 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4382 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4383 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4384 } catch(e) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4385 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4386
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4387 return Sizzle( expr, document, null, [elem] ).length > 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4388 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4389
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4390 Sizzle.contains = function( context, elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4391 // Set document vars if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4392 if ( ( context.ownerDocument || context ) !== document ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4393 setDocument( context );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4394 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4395 return contains( context, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4396 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4397
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4398 Sizzle.attr = function( elem, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4399 var val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4400
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4401 // Set document vars if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4402 if ( ( elem.ownerDocument || elem ) !== document ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4403 setDocument( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4404 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4405
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4406 if ( !documentIsXML ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4407 name = name.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4408 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4409 if ( (val = Expr.attrHandle[ name ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4410 return val( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4411 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4412 if ( documentIsXML || support.attributes ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4413 return elem.getAttribute( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4414 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4415 return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4416 name :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4417 val && val.specified ? val.value : null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4418 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4419
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4420 Sizzle.error = function( msg ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4421 throw new Error( "Syntax error, unrecognized expression: " + msg );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4422 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4423
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4424 // Document sorting and removing duplicates
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4425 Sizzle.uniqueSort = function( results ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4426 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4427 duplicates = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4428 i = 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4429 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4430
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4431 // Unless we *know* we can detect duplicates, assume their presence
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4432 hasDuplicate = !support.detectDuplicates;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4433 results.sort( sortOrder );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4434
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4435 if ( hasDuplicate ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4436 for ( ; (elem = results[i]); i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4437 if ( elem === results[ i - 1 ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4438 j = duplicates.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4439 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4440 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4441 while ( j-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4442 results.splice( duplicates[ j ], 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4443 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4444 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4445
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4446 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4447 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4448
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4449 function siblingCheck( a, b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4450 var cur = b && a,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4451 diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4452
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4453 // Use IE sourceIndex if available on both nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4454 if ( diff ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4455 return diff;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4456 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4457
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4458 // Check if b follows a
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4459 if ( cur ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4460 while ( (cur = cur.nextSibling) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4461 if ( cur === b ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4462 return -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4463 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4464 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4465 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4466
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4467 return a ? 1 : -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4468 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4469
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4470 // Returns a function to use in pseudos for input types
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4471 function createInputPseudo( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4472 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4473 var name = elem.nodeName.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4474 return name === "input" && elem.type === type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4475 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4476 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4477
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4478 // Returns a function to use in pseudos for buttons
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4479 function createButtonPseudo( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4480 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4481 var name = elem.nodeName.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4482 return (name === "input" || name === "button") && elem.type === type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4483 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4484 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4485
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4486 // Returns a function to use in pseudos for positionals
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4487 function createPositionalPseudo( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4488 return markFunction(function( argument ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4489 argument = +argument;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4490 return markFunction(function( seed, matches ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4491 var j,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4492 matchIndexes = fn( [], seed.length, argument ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4493 i = matchIndexes.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4494
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4495 // Match elements found at the specified indexes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4496 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4497 if ( seed[ (j = matchIndexes[i]) ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4498 seed[j] = !(matches[j] = seed[j]);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4499 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4500 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4501 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4502 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4503 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4504
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4505 /**
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4506 * Utility function for retrieving the text value of an array of DOM nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4507 * @param {Array|Element} elem
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4508 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4509 getText = Sizzle.getText = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4510 var node,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4511 ret = "",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4512 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4513 nodeType = elem.nodeType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4514
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4515 if ( !nodeType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4516 // If no nodeType, this is expected to be an array
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4517 for ( ; (node = elem[i]); i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4518 // Do not traverse comment nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4519 ret += getText( node );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4520 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4521 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4522 // Use textContent for elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4523 // innerText usage removed for consistency of new lines (see #11153)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4524 if ( typeof elem.textContent === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4525 return elem.textContent;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4526 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4527 // Traverse its children
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4528 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4529 ret += getText( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4530 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4531 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4532 } else if ( nodeType === 3 || nodeType === 4 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4533 return elem.nodeValue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4534 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4535 // Do not include comment or processing instruction nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4536
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4537 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4538 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4539
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4540 Expr = Sizzle.selectors = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4541
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4542 // Can be adjusted by the user
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4543 cacheLength: 50,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4544
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4545 createPseudo: markFunction,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4546
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4547 match: matchExpr,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4548
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4549 find: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4550
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4551 relative: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4552 ">": { dir: "parentNode", first: true },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4553 " ": { dir: "parentNode" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4554 "+": { dir: "previousSibling", first: true },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4555 "~": { dir: "previousSibling" }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4556 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4557
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4558 preFilter: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4559 "ATTR": function( match ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4560 match[1] = match[1].replace( runescape, funescape );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4561
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4562 // Move the given value to match[3] whether quoted or unquoted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4563 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4564
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4565 if ( match[2] === "~=" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4566 match[3] = " " + match[3] + " ";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4567 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4568
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4569 return match.slice( 0, 4 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4570 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4571
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4572 "CHILD": function( match ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4573 /* matches from matchExpr["CHILD"]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4574 1 type (only|nth|...)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4575 2 what (child|of-type)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4576 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4577 4 xn-component of xn+y argument ([+-]?\d*n|)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4578 5 sign of xn-component
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4579 6 x of xn-component
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4580 7 sign of y-component
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4581 8 y of y-component
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4582 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4583 match[1] = match[1].toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4584
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4585 if ( match[1].slice( 0, 3 ) === "nth" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4586 // nth-* requires argument
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4587 if ( !match[3] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4588 Sizzle.error( match[0] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4589 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4590
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4591 // numeric x and y parameters for Expr.filter.CHILD
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4592 // remember that false/true cast respectively to 0/1
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4593 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4594 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4595
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4596 // other types prohibit arguments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4597 } else if ( match[3] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4598 Sizzle.error( match[0] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4599 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4600
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4601 return match;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4602 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4603
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4604 "PSEUDO": function( match ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4605 var excess,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4606 unquoted = !match[5] && match[2];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4607
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4608 if ( matchExpr["CHILD"].test( match[0] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4609 return null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4610 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4611
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4612 // Accept quoted arguments as-is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4613 if ( match[4] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4614 match[2] = match[4];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4615
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4616 // Strip excess characters from unquoted arguments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4617 } else if ( unquoted && rpseudo.test( unquoted ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4618 // Get excess from tokenize (recursively)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4619 (excess = tokenize( unquoted, true )) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4620 // advance to the next closing parenthesis
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4621 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4622
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4623 // excess is a negative index
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4624 match[0] = match[0].slice( 0, excess );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4625 match[2] = unquoted.slice( 0, excess );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4626 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4627
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4628 // Return only captures needed by the pseudo filter method (type and argument)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4629 return match.slice( 0, 3 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4630 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4631 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4632
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4633 filter: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4634
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4635 "TAG": function( nodeName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4636 if ( nodeName === "*" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4637 return function() { return true; };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4638 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4639
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4640 nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4641 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4642 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4643 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4644 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4645
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4646 "CLASS": function( className ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4647 var pattern = classCache[ className + " " ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4648
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4649 return pattern ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4650 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4651 classCache( className, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4652 return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4653 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4654 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4655
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4656 "ATTR": function( name, operator, check ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4657 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4658 var result = Sizzle.attr( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4659
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4660 if ( result == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4661 return operator === "!=";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4662 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4663 if ( !operator ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4664 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4665 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4666
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4667 result += "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4668
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4669 return operator === "=" ? result === check :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4670 operator === "!=" ? result !== check :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4671 operator === "^=" ? check && result.indexOf( check ) === 0 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4672 operator === "*=" ? check && result.indexOf( check ) > -1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4673 operator === "$=" ? check && result.slice( -check.length ) === check :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4674 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4675 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4676 false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4677 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4678 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4679
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4680 "CHILD": function( type, what, argument, first, last ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4681 var simple = type.slice( 0, 3 ) !== "nth",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4682 forward = type.slice( -4 ) !== "last",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4683 ofType = what === "of-type";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4684
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4685 return first === 1 && last === 0 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4686
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4687 // Shortcut for :nth-*(n)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4688 function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4689 return !!elem.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4690 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4691
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4692 function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4693 var cache, outerCache, node, diff, nodeIndex, start,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4694 dir = simple !== forward ? "nextSibling" : "previousSibling",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4695 parent = elem.parentNode,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4696 name = ofType && elem.nodeName.toLowerCase(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4697 useCache = !xml && !ofType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4698
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4699 if ( parent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4700
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4701 // :(first|last|only)-(child|of-type)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4702 if ( simple ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4703 while ( dir ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4704 node = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4705 while ( (node = node[ dir ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4706 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4707 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4708 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4709 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4710 // Reverse direction for :only-* (if we haven't yet done so)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4711 start = dir = type === "only" && !start && "nextSibling";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4712 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4713 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4714 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4715
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4716 start = [ forward ? parent.firstChild : parent.lastChild ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4717
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4718 // non-xml :nth-child(...) stores cache data on `parent`
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4719 if ( forward && useCache ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4720 // Seek `elem` from a previously-cached index
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4721 outerCache = parent[ expando ] || (parent[ expando ] = {});
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4722 cache = outerCache[ type ] || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4723 nodeIndex = cache[0] === dirruns && cache[1];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4724 diff = cache[0] === dirruns && cache[2];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4725 node = nodeIndex && parent.childNodes[ nodeIndex ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4726
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4727 while ( (node = ++nodeIndex && node && node[ dir ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4728
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4729 // Fallback to seeking `elem` from the start
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4730 (diff = nodeIndex = 0) || start.pop()) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4731
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4732 // When found, cache indexes on `parent` and break
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4733 if ( node.nodeType === 1 && ++diff && node === elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4734 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4735 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4736 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4737 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4738
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4739 // Use previously-cached element index if available
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4740 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4741 diff = cache[1];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4742
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4743 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4744 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4745 // Use the same loop as above to seek `elem` from the start
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4746 while ( (node = ++nodeIndex && node && node[ dir ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4747 (diff = nodeIndex = 0) || start.pop()) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4748
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4749 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4750 // Cache the index of each encountered element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4751 if ( useCache ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4752 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4753 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4754
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4755 if ( node === elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4756 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4757 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4758 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4759 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4760 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4761
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4762 // Incorporate the offset, then check against cycle size
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4763 diff -= last;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4764 return diff === first || ( diff % first === 0 && diff / first >= 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4765 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4766 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4767 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4768
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4769 "PSEUDO": function( pseudo, argument ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4770 // pseudo-class names are case-insensitive
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4771 // http://www.w3.org/TR/selectors/#pseudo-classes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4772 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4773 // Remember that setFilters inherits from pseudos
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4774 var args,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4775 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4776 Sizzle.error( "unsupported pseudo: " + pseudo );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4777
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4778 // The user may use createPseudo to indicate that
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4779 // arguments are needed to create the filter function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4780 // just as Sizzle does
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4781 if ( fn[ expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4782 return fn( argument );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4783 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4784
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4785 // But maintain support for old signatures
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4786 if ( fn.length > 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4787 args = [ pseudo, pseudo, "", argument ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4788 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4789 markFunction(function( seed, matches ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4790 var idx,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4791 matched = fn( seed, argument ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4792 i = matched.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4793 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4794 idx = indexOf.call( seed, matched[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4795 seed[ idx ] = !( matches[ idx ] = matched[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4796 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4797 }) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4798 function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4799 return fn( elem, 0, args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4800 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4801 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4802
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4803 return fn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4804 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4805 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4806
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4807 pseudos: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4808 // Potentially complex pseudos
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4809 "not": markFunction(function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4810 // Trim the selector passed to compile
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4811 // to avoid treating leading and trailing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4812 // spaces as combinators
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4813 var input = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4814 results = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4815 matcher = compile( selector.replace( rtrim, "$1" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4816
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4817 return matcher[ expando ] ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4818 markFunction(function( seed, matches, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4819 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4820 unmatched = matcher( seed, null, xml, [] ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4821 i = seed.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4823 // Match elements unmatched by `matcher`
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4824 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4825 if ( (elem = unmatched[i]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4826 seed[i] = !(matches[i] = elem);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4827 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4828 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4829 }) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4830 function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4831 input[0] = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4832 matcher( input, null, xml, results );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4833 return !results.pop();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4834 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4835 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4836
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4837 "has": markFunction(function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4838 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4839 return Sizzle( selector, elem ).length > 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4840 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4841 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4842
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4843 "contains": markFunction(function( text ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4844 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4845 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4846 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4847 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4848
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4849 // "Whether an element is represented by a :lang() selector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4850 // is based solely on the element's language value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4851 // being equal to the identifier C,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4852 // or beginning with the identifier C immediately followed by "-".
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4853 // The matching of C against the element's language value is performed case-insensitively.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4854 // The identifier C does not have to be a valid language name."
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4855 // http://www.w3.org/TR/selectors/#lang-pseudo
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4856 "lang": markFunction( function( lang ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4857 // lang value must be a valid identifider
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4858 if ( !ridentifier.test(lang || "") ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4859 Sizzle.error( "unsupported lang: " + lang );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4860 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4861 lang = lang.replace( runescape, funescape ).toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4862 return function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4863 var elemLang;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4864 do {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4865 if ( (elemLang = documentIsXML ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4866 elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4867 elem.lang) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4868
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4869 elemLang = elemLang.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4870 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4871 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4872 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4873 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4874 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4875 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4876
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4877 // Miscellaneous
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4878 "target": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4879 var hash = window.location && window.location.hash;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4880 return hash && hash.slice( 1 ) === elem.id;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4881 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4882
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4883 "root": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4884 return elem === docElem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4885 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4886
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4887 "focus": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4888 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4889 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4890
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4891 // Boolean properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4892 "enabled": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4893 return elem.disabled === false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4894 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4895
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4896 "disabled": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4897 return elem.disabled === true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4898 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4899
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4900 "checked": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4901 // In CSS3, :checked should return both checked and selected elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4902 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4903 var nodeName = elem.nodeName.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4904 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4905 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4906
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4907 "selected": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4908 // Accessing this property makes selected-by-default
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4909 // options in Safari work properly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4910 if ( elem.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4911 elem.parentNode.selectedIndex;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4912 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4913
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4914 return elem.selected === true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4915 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4916
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4917 // Contents
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4918 "empty": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4919 // http://www.w3.org/TR/selectors/#empty-pseudo
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4920 // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4921 // not comment, processing instructions, or others
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4922 // Thanks to Diego Perini for the nodeName shortcut
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4923 // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4924 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4925 if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4926 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4927 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4928 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4929 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4930 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4931
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4932 "parent": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4933 return !Expr.pseudos["empty"]( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4934 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4935
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4936 // Element/input types
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4937 "header": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4938 return rheader.test( elem.nodeName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4939 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4940
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4941 "input": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4942 return rinputs.test( elem.nodeName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4943 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4944
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4945 "button": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4946 var name = elem.nodeName.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4947 return name === "input" && elem.type === "button" || name === "button";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4948 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4949
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4950 "text": function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4951 var attr;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4952 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4953 // use getAttribute instead to test this case
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4954 return elem.nodeName.toLowerCase() === "input" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4955 elem.type === "text" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4956 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4957 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4958
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4959 // Position-in-collection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4960 "first": createPositionalPseudo(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4961 return [ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4962 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4963
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4964 "last": createPositionalPseudo(function( matchIndexes, length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4965 return [ length - 1 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4966 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4967
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4968 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4969 return [ argument < 0 ? argument + length : argument ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4970 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4971
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4972 "even": createPositionalPseudo(function( matchIndexes, length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4973 var i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4974 for ( ; i < length; i += 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4975 matchIndexes.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4976 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4977 return matchIndexes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4978 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4979
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4980 "odd": createPositionalPseudo(function( matchIndexes, length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4981 var i = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4982 for ( ; i < length; i += 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4983 matchIndexes.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4984 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4985 return matchIndexes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4986 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4987
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4988 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4989 var i = argument < 0 ? argument + length : argument;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4990 for ( ; --i >= 0; ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4991 matchIndexes.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4992 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4993 return matchIndexes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4994 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4995
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4996 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4997 var i = argument < 0 ? argument + length : argument;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4998 for ( ; ++i < length; ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4999 matchIndexes.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5000 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5001 return matchIndexes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5002 })
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5003 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5004 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5005
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5006 // Add button/input type pseudos
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5007 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5008 Expr.pseudos[ i ] = createInputPseudo( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5009 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5010 for ( i in { submit: true, reset: true } ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5011 Expr.pseudos[ i ] = createButtonPseudo( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5012 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5013
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5014 function tokenize( selector, parseOnly ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5015 var matched, match, tokens, type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5016 soFar, groups, preFilters,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5017 cached = tokenCache[ selector + " " ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5018
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5019 if ( cached ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5020 return parseOnly ? 0 : cached.slice( 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5021 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5022
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5023 soFar = selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5024 groups = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5025 preFilters = Expr.preFilter;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5026
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5027 while ( soFar ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5028
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5029 // Comma and first run
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5030 if ( !matched || (match = rcomma.exec( soFar )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5031 if ( match ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5032 // Don't consume trailing commas as valid
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5033 soFar = soFar.slice( match[0].length ) || soFar;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5034 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5035 groups.push( tokens = [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5036 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5037
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5038 matched = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5039
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5040 // Combinators
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5041 if ( (match = rcombinators.exec( soFar )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5042 matched = match.shift();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5043 tokens.push( {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5044 value: matched,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5045 // Cast descendant combinators to space
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5046 type: match[0].replace( rtrim, " " )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5047 } );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5048 soFar = soFar.slice( matched.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5049 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5050
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5051 // Filters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5052 for ( type in Expr.filter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5053 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5054 (match = preFilters[ type ]( match ))) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5055 matched = match.shift();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5056 tokens.push( {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5057 value: matched,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5058 type: type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5059 matches: match
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5060 } );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5061 soFar = soFar.slice( matched.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5062 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5063 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5064
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5065 if ( !matched ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5066 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5067 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5068 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5069
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5070 // Return the length of the invalid excess
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5071 // if we're just parsing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5072 // Otherwise, throw an error or return tokens
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5073 return parseOnly ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5074 soFar.length :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5075 soFar ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5076 Sizzle.error( selector ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5077 // Cache the tokens
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5078 tokenCache( selector, groups ).slice( 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5079 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5080
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5081 function toSelector( tokens ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5082 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5083 len = tokens.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5084 selector = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5085 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5086 selector += tokens[i].value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5087 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5088 return selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5089 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5090
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5091 function addCombinator( matcher, combinator, base ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5092 var dir = combinator.dir,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5093 checkNonElements = base && dir === "parentNode",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5094 doneName = done++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5095
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5096 return combinator.first ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5097 // Check against closest ancestor/preceding element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5098 function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5099 while ( (elem = elem[ dir ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5100 if ( elem.nodeType === 1 || checkNonElements ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5101 return matcher( elem, context, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5102 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5103 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5104 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5105
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5106 // Check against all ancestor/preceding elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5107 function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5108 var data, cache, outerCache,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5109 dirkey = dirruns + " " + doneName;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5110
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5111 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5112 if ( xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5113 while ( (elem = elem[ dir ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5114 if ( elem.nodeType === 1 || checkNonElements ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5115 if ( matcher( elem, context, xml ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5116 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5117 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5118 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5119 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5120 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5121 while ( (elem = elem[ dir ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5122 if ( elem.nodeType === 1 || checkNonElements ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5123 outerCache = elem[ expando ] || (elem[ expando ] = {});
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5124 if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5125 if ( (data = cache[1]) === true || data === cachedruns ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5126 return data === true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5127 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5128 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5129 cache = outerCache[ dir ] = [ dirkey ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5130 cache[1] = matcher( elem, context, xml ) || cachedruns;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5131 if ( cache[1] === true ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5132 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5133 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5134 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5135 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5136 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5137 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5138 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5139 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5140
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5141 function elementMatcher( matchers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5142 return matchers.length > 1 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5143 function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5144 var i = matchers.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5145 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5146 if ( !matchers[i]( elem, context, xml ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5147 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5148 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5149 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5150 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5151 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5152 matchers[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5153 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5154
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5155 function condense( unmatched, map, filter, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5156 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5157 newUnmatched = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5158 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5159 len = unmatched.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5160 mapped = map != null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5161
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5162 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5163 if ( (elem = unmatched[i]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5164 if ( !filter || filter( elem, context, xml ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5165 newUnmatched.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5166 if ( mapped ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5167 map.push( i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5168 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5169 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5170 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5171 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5172
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5173 return newUnmatched;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5174 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5175
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5176 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5177 if ( postFilter && !postFilter[ expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5178 postFilter = setMatcher( postFilter );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5179 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5180 if ( postFinder && !postFinder[ expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5181 postFinder = setMatcher( postFinder, postSelector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5182 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5183 return markFunction(function( seed, results, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5184 var temp, i, elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5185 preMap = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5186 postMap = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5187 preexisting = results.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5188
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5189 // Get initial elements from seed or context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5190 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5191
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5192 // Prefilter to get matcher input, preserving a map for seed-results synchronization
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5193 matcherIn = preFilter && ( seed || !selector ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5194 condense( elems, preMap, preFilter, context, xml ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5195 elems,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5196
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5197 matcherOut = matcher ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5198 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5199 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5200
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5201 // ...intermediate processing is necessary
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5202 [] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5203
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5204 // ...otherwise use results directly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5205 results :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5206 matcherIn;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5207
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5208 // Find primary matches
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5209 if ( matcher ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5210 matcher( matcherIn, matcherOut, context, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5211 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5212
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5213 // Apply postFilter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5214 if ( postFilter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5215 temp = condense( matcherOut, postMap );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5216 postFilter( temp, [], context, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5217
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5218 // Un-match failing elements by moving them back to matcherIn
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5219 i = temp.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5220 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5221 if ( (elem = temp[i]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5222 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5223 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5224 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5225 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5226
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5227 if ( seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5228 if ( postFinder || preFilter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5229 if ( postFinder ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5230 // Get the final matcherOut by condensing this intermediate into postFinder contexts
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5231 temp = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5232 i = matcherOut.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5233 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5234 if ( (elem = matcherOut[i]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5235 // Restore matcherIn since elem is not yet a final match
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5236 temp.push( (matcherIn[i] = elem) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5237 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5238 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5239 postFinder( null, (matcherOut = []), temp, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5240 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5241
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5242 // Move matched elements from seed to results to keep them synchronized
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5243 i = matcherOut.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5244 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5245 if ( (elem = matcherOut[i]) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5246 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5247
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5248 seed[temp] = !(results[temp] = elem);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5250 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5251 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5252
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5253 // Add elements to results, through postFinder if defined
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5254 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5255 matcherOut = condense(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5256 matcherOut === results ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5257 matcherOut.splice( preexisting, matcherOut.length ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5258 matcherOut
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5259 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5260 if ( postFinder ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5261 postFinder( null, results, matcherOut, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5262 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5263 push.apply( results, matcherOut );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5264 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5265 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5266 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5267 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5268
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5269 function matcherFromTokens( tokens ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5270 var checkContext, matcher, j,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5271 len = tokens.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5272 leadingRelative = Expr.relative[ tokens[0].type ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5273 implicitRelative = leadingRelative || Expr.relative[" "],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5274 i = leadingRelative ? 1 : 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5275
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5276 // The foundational matcher ensures that elements are reachable from top-level context(s)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5277 matchContext = addCombinator( function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5278 return elem === checkContext;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5279 }, implicitRelative, true ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5280 matchAnyContext = addCombinator( function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5281 return indexOf.call( checkContext, elem ) > -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5282 }, implicitRelative, true ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5283 matchers = [ function( elem, context, xml ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5284 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5285 (checkContext = context).nodeType ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5286 matchContext( elem, context, xml ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5287 matchAnyContext( elem, context, xml ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5288 } ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5289
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5290 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5291 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5292 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5293 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5294 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5295
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5296 // Return special upon seeing a positional matcher
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5297 if ( matcher[ expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5298 // Find the next relative operator (if any) for proper handling
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5299 j = ++i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5300 for ( ; j < len; j++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5301 if ( Expr.relative[ tokens[j].type ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5302 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5303 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5304 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5305 return setMatcher(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5306 i > 1 && elementMatcher( matchers ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5307 i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5308 matcher,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5309 i < j && matcherFromTokens( tokens.slice( i, j ) ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5310 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5311 j < len && toSelector( tokens )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5312 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5313 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5314 matchers.push( matcher );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5315 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5316 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5317
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5318 return elementMatcher( matchers );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5319 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5320
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5321 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5322 // A counter to specify which element is currently being matched
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5323 var matcherCachedRuns = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5324 bySet = setMatchers.length > 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5325 byElement = elementMatchers.length > 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5326 superMatcher = function( seed, context, xml, results, expandContext ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5327 var elem, j, matcher,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5328 setMatched = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5329 matchedCount = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5330 i = "0",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5331 unmatched = seed && [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5332 outermost = expandContext != null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5333 contextBackup = outermostContext,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5334 // We must always have either seed elements or context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5335 elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5336 // Use integer dirruns iff this is the outermost matcher
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5337 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5338
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5339 if ( outermost ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5340 outermostContext = context !== document && context;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5341 cachedruns = matcherCachedRuns;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5342 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5343
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5344 // Add elements passing elementMatchers directly to results
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5345 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5346 for ( ; (elem = elems[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5347 if ( byElement && elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5348 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5349 while ( (matcher = elementMatchers[j++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5350 if ( matcher( elem, context, xml ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5351 results.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5352 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5353 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5354 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5355 if ( outermost ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5356 dirruns = dirrunsUnique;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5357 cachedruns = ++matcherCachedRuns;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5358 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5359 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5360
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5361 // Track unmatched elements for set filters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5362 if ( bySet ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5363 // They will have gone through all possible matchers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5364 if ( (elem = !matcher && elem) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5365 matchedCount--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5366 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5367
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5368 // Lengthen the array for every element, matched or not
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5369 if ( seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5370 unmatched.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5371 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5372 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5373 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5374
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5375 // Apply set filters to unmatched elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5376 matchedCount += i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5377 if ( bySet && i !== matchedCount ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5378 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5379 while ( (matcher = setMatchers[j++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5380 matcher( unmatched, setMatched, context, xml );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5381 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5382
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5383 if ( seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5384 // Reintegrate element matches to eliminate the need for sorting
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5385 if ( matchedCount > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5386 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5387 if ( !(unmatched[i] || setMatched[i]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5388 setMatched[i] = pop.call( results );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5389 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5390 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5391 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5392
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5393 // Discard index placeholder values to get only actual matches
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5394 setMatched = condense( setMatched );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5395 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5396
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5397 // Add matches to results
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5398 push.apply( results, setMatched );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5399
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5400 // Seedless set matches succeeding multiple successful matchers stipulate sorting
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5401 if ( outermost && !seed && setMatched.length > 0 &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5402 ( matchedCount + setMatchers.length ) > 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5403
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5404 Sizzle.uniqueSort( results );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5405 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5406 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5407
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5408 // Override manipulation of globals by nested matchers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5409 if ( outermost ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5410 dirruns = dirrunsUnique;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5411 outermostContext = contextBackup;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5412 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5413
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5414 return unmatched;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5415 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5416
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5417 return bySet ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5418 markFunction( superMatcher ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5419 superMatcher;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5420 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5421
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5422 compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5423 var i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5424 setMatchers = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5425 elementMatchers = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5426 cached = compilerCache[ selector + " " ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5427
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5428 if ( !cached ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5429 // Generate a function of recursive functions that can be used to check each element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5430 if ( !group ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5431 group = tokenize( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5432 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5433 i = group.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5434 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5435 cached = matcherFromTokens( group[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5436 if ( cached[ expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5437 setMatchers.push( cached );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5438 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5439 elementMatchers.push( cached );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5440 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5441 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5442
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5443 // Cache the compiled function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5444 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5445 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5446 return cached;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5447 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5448
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5449 function multipleContexts( selector, contexts, results ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5450 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5451 len = contexts.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5452 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5453 Sizzle( selector, contexts[i], results );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5454 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5455 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5456 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5457
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5458 function select( selector, context, results, seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5459 var i, tokens, token, type, find,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5460 match = tokenize( selector );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5461
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5462 if ( !seed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5463 // Try to minimize operations if there is only one group
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5464 if ( match.length === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5465
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5466 // Take a shortcut and set the context if the root selector is an ID
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5467 tokens = match[0] = match[0].slice( 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5468 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5469 context.nodeType === 9 && !documentIsXML &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5470 Expr.relative[ tokens[1].type ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5471
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5472 context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5473 if ( !context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5474 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5475 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5476
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5477 selector = selector.slice( tokens.shift().value.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5478 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5479
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5480 // Fetch a seed set for right-to-left matching
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5481 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5482 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5483 token = tokens[i];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5484
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5485 // Abort if we hit a combinator
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5486 if ( Expr.relative[ (type = token.type) ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5487 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5488 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5489 if ( (find = Expr.find[ type ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5490 // Search, expanding context for leading sibling combinators
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5491 if ( (seed = find(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5492 token.matches[0].replace( runescape, funescape ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5493 rsibling.test( tokens[0].type ) && context.parentNode || context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5494 )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5495
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5496 // If seed is empty or no tokens remain, we can return early
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5497 tokens.splice( i, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5498 selector = seed.length && toSelector( tokens );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5499 if ( !selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5500 push.apply( results, slice.call( seed, 0 ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5501 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5502 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5503
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5504 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5505 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5506 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5507 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5508 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5509 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5510
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5511 // Compile and execute a filtering function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5512 // Provide `match` to avoid retokenization if we modified the selector above
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5513 compile( selector, match )(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5514 seed,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5515 context,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5516 documentIsXML,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5517 results,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5518 rsibling.test( selector )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5519 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5520 return results;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5521 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5522
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5523 // Deprecated
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5524 Expr.pseudos["nth"] = Expr.pseudos["eq"];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5525
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5526 // Easy API for creating new setFilters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5527 function setFilters() {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5528 Expr.filters = setFilters.prototype = Expr.pseudos;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5529 Expr.setFilters = new setFilters();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5530
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5531 // Initialize with the default document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5532 setDocument();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5533
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5534 // Override sizzle attribute retrieval
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5535 Sizzle.attr = jQuery.attr;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5536 jQuery.find = Sizzle;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5537 jQuery.expr = Sizzle.selectors;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5538 jQuery.expr[":"] = jQuery.expr.pseudos;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5539 jQuery.unique = Sizzle.uniqueSort;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5540 jQuery.text = Sizzle.getText;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5541 jQuery.isXMLDoc = Sizzle.isXML;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5542 jQuery.contains = Sizzle.contains;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5543
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5544
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5545 })( window );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5546 var runtil = /Until$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5547 rparentsprev = /^(?:parents|prev(?:Until|All))/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5548 isSimple = /^.[^:#\[\.,]*$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5549 rneedsContext = jQuery.expr.match.needsContext,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5550 // methods guaranteed to produce a unique set when starting from a unique set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5551 guaranteedUnique = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5552 children: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5553 contents: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5554 next: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5555 prev: true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5556 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5557
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5558 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5559 find: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5560 var i, ret, self,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5561 len = this.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5562
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5563 if ( typeof selector !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5564 self = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5565 return this.pushStack( jQuery( selector ).filter(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5566 for ( i = 0; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5567 if ( jQuery.contains( self[ i ], this ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5568 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5569 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5570 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5571 }) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5572 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5573
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5574 ret = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5575 for ( i = 0; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5576 jQuery.find( selector, this[ i ], ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5577 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5578
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5579 // Needed because $( selector, context ) becomes $( context ).find( selector )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5580 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5581 ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5582 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5583 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5584
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5585 has: function( target ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5586 var i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5587 targets = jQuery( target, this ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5588 len = targets.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5589
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5590 return this.filter(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5591 for ( i = 0; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5592 if ( jQuery.contains( this, targets[i] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5593 return true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5594 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5595 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5596 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5597 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5598
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5599 not: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5600 return this.pushStack( winnow(this, selector, false) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5601 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5602
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5603 filter: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5604 return this.pushStack( winnow(this, selector, true) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5605 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5606
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5607 is: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5608 return !!selector && (
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5609 typeof selector === "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5610 // If this is a positional/relative selector, check membership in the returned set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5611 // so $("p:first").is("p:last") won't return true for a doc with two "p".
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5612 rneedsContext.test( selector ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5613 jQuery( selector, this.context ).index( this[0] ) >= 0 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5614 jQuery.filter( selector, this ).length > 0 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5615 this.filter( selector ).length > 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5616 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5617
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5618 closest: function( selectors, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5619 var cur,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5620 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5621 l = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5622 ret = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5623 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5624 jQuery( selectors, context || this.context ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5625 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5626
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5627 for ( ; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5628 cur = this[i];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5629
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5630 while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5631 if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5632 ret.push( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5633 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5634 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5635 cur = cur.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5636 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5637 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5638
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5639 return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5640 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5641
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5642 // Determine the position of an element within
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5643 // the matched set of elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5644 index: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5645
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5646 // No argument, return index in parent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5647 if ( !elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5648 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5649 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5650
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5651 // index in selector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5652 if ( typeof elem === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5653 return jQuery.inArray( this[0], jQuery( elem ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5654 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5655
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5656 // Locate the position of the desired element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5657 return jQuery.inArray(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5658 // If it receives a jQuery object, the first element is used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5659 elem.jquery ? elem[0] : elem, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5660 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5661
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5662 add: function( selector, context ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5663 var set = typeof selector === "string" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5664 jQuery( selector, context ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5665 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5666 all = jQuery.merge( this.get(), set );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5667
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5668 return this.pushStack( jQuery.unique(all) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5669 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5670
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5671 addBack: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5672 return this.add( selector == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5673 this.prevObject : this.prevObject.filter(selector)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5674 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5675 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5676 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5677
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5678 jQuery.fn.andSelf = jQuery.fn.addBack;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5679
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5680 function sibling( cur, dir ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5681 do {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5682 cur = cur[ dir ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5683 } while ( cur && cur.nodeType !== 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5684
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5685 return cur;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5686 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5687
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5688 jQuery.each({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5689 parent: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5690 var parent = elem.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5691 return parent && parent.nodeType !== 11 ? parent : null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5692 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5693 parents: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5694 return jQuery.dir( elem, "parentNode" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5695 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5696 parentsUntil: function( elem, i, until ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5697 return jQuery.dir( elem, "parentNode", until );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5698 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5699 next: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5700 return sibling( elem, "nextSibling" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5701 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5702 prev: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5703 return sibling( elem, "previousSibling" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5704 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5705 nextAll: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5706 return jQuery.dir( elem, "nextSibling" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5707 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5708 prevAll: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5709 return jQuery.dir( elem, "previousSibling" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5710 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5711 nextUntil: function( elem, i, until ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5712 return jQuery.dir( elem, "nextSibling", until );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5713 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5714 prevUntil: function( elem, i, until ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5715 return jQuery.dir( elem, "previousSibling", until );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5716 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5717 siblings: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5718 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5719 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5720 children: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5721 return jQuery.sibling( elem.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5722 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5723 contents: function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5724 return jQuery.nodeName( elem, "iframe" ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5725 elem.contentDocument || elem.contentWindow.document :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5726 jQuery.merge( [], elem.childNodes );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5727 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5728 }, function( name, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5729 jQuery.fn[ name ] = function( until, selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5730 var ret = jQuery.map( this, fn, until );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5731
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5732 if ( !runtil.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5733 selector = until;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5734 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5735
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5736 if ( selector && typeof selector === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5737 ret = jQuery.filter( selector, ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5738 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5739
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5740 ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5741
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5742 if ( this.length > 1 && rparentsprev.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5743 ret = ret.reverse();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5744 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5745
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5746 return this.pushStack( ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5747 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5748 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5749
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5750 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5751 filter: function( expr, elems, not ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5752 if ( not ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5753 expr = ":not(" + expr + ")";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5754 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5755
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5756 return elems.length === 1 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5757 jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5758 jQuery.find.matches(expr, elems);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5759 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5760
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5761 dir: function( elem, dir, until ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5762 var matched = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5763 cur = elem[ dir ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5764
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5765 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5766 if ( cur.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5767 matched.push( cur );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5768 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5769 cur = cur[dir];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5770 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5771 return matched;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5772 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5773
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5774 sibling: function( n, elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5775 var r = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5776
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5777 for ( ; n; n = n.nextSibling ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5778 if ( n.nodeType === 1 && n !== elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5779 r.push( n );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5780 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5781 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5782
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5783 return r;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5784 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5785 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5786
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5787 // Implement the identical functionality for filter and not
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5788 function winnow( elements, qualifier, keep ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5789
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5790 // Can't pass null or undefined to indexOf in Firefox 4
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5791 // Set to 0 to skip string check
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5792 qualifier = qualifier || 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5793
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5794 if ( jQuery.isFunction( qualifier ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5795 return jQuery.grep(elements, function( elem, i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5796 var retVal = !!qualifier.call( elem, i, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5797 return retVal === keep;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5798 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5799
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5800 } else if ( qualifier.nodeType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5801 return jQuery.grep(elements, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5802 return ( elem === qualifier ) === keep;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5803 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5804
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5805 } else if ( typeof qualifier === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5806 var filtered = jQuery.grep(elements, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5807 return elem.nodeType === 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5808 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5809
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5810 if ( isSimple.test( qualifier ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5811 return jQuery.filter(qualifier, filtered, !keep);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5812 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5813 qualifier = jQuery.filter( qualifier, filtered );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5814 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5815 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5816
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5817 return jQuery.grep(elements, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5818 return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5819 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5820 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5821 function createSafeFragment( document ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5822 var list = nodeNames.split( "|" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5823 safeFrag = document.createDocumentFragment();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5824
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5825 if ( safeFrag.createElement ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5826 while ( list.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5827 safeFrag.createElement(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5828 list.pop()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5829 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5830 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5831 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5832 return safeFrag;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5833 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5834
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5835 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5836 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5837 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5838 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5839 rleadingWhitespace = /^\s+/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5840 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5841 rtagName = /<([\w:]+)/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5842 rtbody = /<tbody/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5843 rhtml = /<|&#?\w+;/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5844 rnoInnerhtml = /<(?:script|style|link)/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5845 manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5846 // checked="checked" or checked
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5847 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5848 rscriptType = /^$|\/(?:java|ecma)script/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5849 rscriptTypeMasked = /^true\/(.*)/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5850 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5851
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5852 // We have to close these tags to support XHTML (#13200)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5853 wrapMap = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5854 option: [ 1, "<select multiple='multiple'>", "</select>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5855 legend: [ 1, "<fieldset>", "</fieldset>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5856 area: [ 1, "<map>", "</map>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5857 param: [ 1, "<object>", "</object>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5858 thead: [ 1, "<table>", "</table>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5859 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5860 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5861 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5862
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5863 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5864 // unless wrapped in a div with non-breaking characters in front of it.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5865 _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5866 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5867 safeFragment = createSafeFragment( document ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5868 fragmentDiv = safeFragment.appendChild( document.createElement("div") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5869
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5870 wrapMap.optgroup = wrapMap.option;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5871 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5872 wrapMap.th = wrapMap.td;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5873
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5874 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5875 text: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5876 return jQuery.access( this, function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5877 return value === undefined ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5878 jQuery.text( this ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5879 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5880 }, null, value, arguments.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5881 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5882
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5883 wrapAll: function( html ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5884 if ( jQuery.isFunction( html ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5885 return this.each(function(i) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5886 jQuery(this).wrapAll( html.call(this, i) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5887 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5888 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5889
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5890 if ( this[0] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5891 // The elements to wrap the target around
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5892 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5893
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5894 if ( this[0].parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5895 wrap.insertBefore( this[0] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5896 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5897
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5898 wrap.map(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5899 var elem = this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5900
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5901 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5902 elem = elem.firstChild;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5903 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5904
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5905 return elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5906 }).append( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5907 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5908
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5909 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5910 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5911
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5912 wrapInner: function( html ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5913 if ( jQuery.isFunction( html ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5914 return this.each(function(i) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5915 jQuery(this).wrapInner( html.call(this, i) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5916 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5917 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5918
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5919 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5920 var self = jQuery( this ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5921 contents = self.contents();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5922
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5923 if ( contents.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5924 contents.wrapAll( html );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5925
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5926 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5927 self.append( html );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5928 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5929 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5930 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5931
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5932 wrap: function( html ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5933 var isFunction = jQuery.isFunction( html );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5934
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5935 return this.each(function(i) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5936 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5937 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5938 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5939
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5940 unwrap: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5941 return this.parent().each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5942 if ( !jQuery.nodeName( this, "body" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5943 jQuery( this ).replaceWith( this.childNodes );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5944 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5945 }).end();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5946 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5947
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5948 append: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5949 return this.domManip(arguments, true, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5950 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5951 this.appendChild( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5952 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5953 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5954 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5955
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5956 prepend: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5957 return this.domManip(arguments, true, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5958 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5959 this.insertBefore( elem, this.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5960 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5961 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5962 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5963
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5964 before: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5965 return this.domManip( arguments, false, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5966 if ( this.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5967 this.parentNode.insertBefore( elem, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5968 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5969 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5970 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5971
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5972 after: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5973 return this.domManip( arguments, false, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5974 if ( this.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5975 this.parentNode.insertBefore( elem, this.nextSibling );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5976 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5977 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5978 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5979
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5980 // keepData is for internal use only--do not document
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5981 remove: function( selector, keepData ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5982 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5983 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5984
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5985 for ( ; (elem = this[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5986 if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5987 if ( !keepData && elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5988 jQuery.cleanData( getAll( elem ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5989 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5990
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5991 if ( elem.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5992 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5993 setGlobalEval( getAll( elem, "script" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5994 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5995 elem.parentNode.removeChild( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5996 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5997 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5998 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5999
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6000 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6001 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6002
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6003 empty: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6004 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6005 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6006
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6007 for ( ; (elem = this[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6008 // Remove element nodes and prevent memory leaks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6009 if ( elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6010 jQuery.cleanData( getAll( elem, false ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6011 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6012
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6013 // Remove any remaining nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6014 while ( elem.firstChild ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6015 elem.removeChild( elem.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6016 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6017
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6018 // If this is a select, ensure that it displays empty (#12336)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6019 // Support: IE<9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6020 if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6021 elem.options.length = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6022 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6023 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6024
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6025 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6026 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6027
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6028 clone: function( dataAndEvents, deepDataAndEvents ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6029 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6030 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6031
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6032 return this.map( function () {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6033 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6034 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6035 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6036
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6037 html: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6038 return jQuery.access( this, function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6039 var elem = this[0] || {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6040 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6041 l = this.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6042
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6043 if ( value === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6044 return elem.nodeType === 1 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6045 elem.innerHTML.replace( rinlinejQuery, "" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6046 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6047 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6048
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6049 // See if we can take a shortcut and just use innerHTML
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6050 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6051 ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6052 ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6053 !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6054
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6055 value = value.replace( rxhtmlTag, "<$1></$2>" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6056
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6057 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6058 for (; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6059 // Remove element nodes and prevent memory leaks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6060 elem = this[i] || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6061 if ( elem.nodeType === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6062 jQuery.cleanData( getAll( elem, false ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6063 elem.innerHTML = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6064 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6065 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6066
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6067 elem = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6068
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6069 // If using innerHTML throws an exception, use the fallback method
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6070 } catch(e) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6071 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6072
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6073 if ( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6074 this.empty().append( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6075 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6076 }, null, value, arguments.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6077 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6078
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6079 replaceWith: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6080 var isFunc = jQuery.isFunction( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6081
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6082 // Make sure that the elements are removed from the DOM before they are inserted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6083 // this can help fix replacing a parent with child elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6084 if ( !isFunc && typeof value !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6085 value = jQuery( value ).not( this ).detach();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6086 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6087
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6088 return this.domManip( [ value ], true, function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6089 var next = this.nextSibling,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6090 parent = this.parentNode;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6091
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6092 if ( parent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6093 jQuery( this ).remove();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6094 parent.insertBefore( elem, next );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6095 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6096 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6097 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6098
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6099 detach: function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6100 return this.remove( selector, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6101 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6102
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6103 domManip: function( args, table, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6104
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6105 // Flatten any nested arrays
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6106 args = core_concat.apply( [], args );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6107
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6108 var first, node, hasScripts,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6109 scripts, doc, fragment,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6110 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6111 l = this.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6112 set = this,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6113 iNoClone = l - 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6114 value = args[0],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6115 isFunction = jQuery.isFunction( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6116
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6117 // We can't cloneNode fragments that contain checked, in WebKit
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6118 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6119 return this.each(function( index ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6120 var self = set.eq( index );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6121 if ( isFunction ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6122 args[0] = value.call( this, index, table ? self.html() : undefined );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6123 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6124 self.domManip( args, table, callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6125 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6126 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6127
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6128 if ( l ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6129 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6130 first = fragment.firstChild;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6131
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6132 if ( fragment.childNodes.length === 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6133 fragment = first;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6134 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6135
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6136 if ( first ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6137 table = table && jQuery.nodeName( first, "tr" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6138 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6139 hasScripts = scripts.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6140
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6141 // Use the original fragment for the last item instead of the first because it can end up
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6142 // being emptied incorrectly in certain situations (#8070).
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6143 for ( ; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6144 node = fragment;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6145
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6146 if ( i !== iNoClone ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6147 node = jQuery.clone( node, true, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6148
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6149 // Keep references to cloned scripts for later restoration
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6150 if ( hasScripts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6151 jQuery.merge( scripts, getAll( node, "script" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6152 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6153 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6154
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6155 callback.call(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6156 table && jQuery.nodeName( this[i], "table" ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6157 findOrAppend( this[i], "tbody" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6158 this[i],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6159 node,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6160 i
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6161 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6162 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6163
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6164 if ( hasScripts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6165 doc = scripts[ scripts.length - 1 ].ownerDocument;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6166
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6167 // Reenable scripts
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6168 jQuery.map( scripts, restoreScript );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6169
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6170 // Evaluate executable scripts on first document insertion
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6171 for ( i = 0; i < hasScripts; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6172 node = scripts[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6173 if ( rscriptType.test( node.type || "" ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6174 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6175
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6176 if ( node.src ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6177 // Hope ajax is available...
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6178 jQuery.ajax({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6179 url: node.src,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6180 type: "GET",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6181 dataType: "script",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6182 async: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6183 global: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6184 "throws": true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6185 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6186 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6187 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6188 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6189 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6190 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6191 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6192
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6193 // Fix #11809: Avoid leaking memory
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6194 fragment = first = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6195 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6196 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6197
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6198 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6199 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6200 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6201
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6202 function findOrAppend( elem, tag ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6203 return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6204 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6205
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6206 // Replace/restore the type attribute of script elements for safe DOM manipulation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6207 function disableScript( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6208 var attr = elem.getAttributeNode("type");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6209 elem.type = ( attr && attr.specified ) + "/" + elem.type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6210 return elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6211 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6212 function restoreScript( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6213 var match = rscriptTypeMasked.exec( elem.type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6214 if ( match ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6215 elem.type = match[1];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6216 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6217 elem.removeAttribute("type");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6218 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6219 return elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6220 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6221
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6222 // Mark scripts as having already been evaluated
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6223 function setGlobalEval( elems, refElements ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6224 var elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6225 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6226 for ( ; (elem = elems[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6227 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6228 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6229 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6230
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6231 function cloneCopyEvent( src, dest ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6232
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6233 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6234 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6235 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6236
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6237 var type, i, l,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6238 oldData = jQuery._data( src ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6239 curData = jQuery._data( dest, oldData ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6240 events = oldData.events;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6241
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6242 if ( events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6243 delete curData.handle;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6244 curData.events = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6245
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6246 for ( type in events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6247 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6248 jQuery.event.add( dest, type, events[ type ][ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6250 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6251 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6252
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6253 // make the cloned public data object a copy from the original
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6254 if ( curData.data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6255 curData.data = jQuery.extend( {}, curData.data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6256 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6257 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6258
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6259 function fixCloneNodeIssues( src, dest ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6260 var nodeName, e, data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6261
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6262 // We do not need to do anything for non-Elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6263 if ( dest.nodeType !== 1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6264 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6265 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6266
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6267 nodeName = dest.nodeName.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6268
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6269 // IE6-8 copies events bound via attachEvent when using cloneNode.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6270 if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6271 data = jQuery._data( dest );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6272
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6273 for ( e in data.events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6274 jQuery.removeEvent( dest, e, data.handle );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6275 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6276
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6277 // Event data gets referenced instead of copied if the expando gets copied too
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6278 dest.removeAttribute( jQuery.expando );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6279 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6280
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6281 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6282 if ( nodeName === "script" && dest.text !== src.text ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6283 disableScript( dest ).text = src.text;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6284 restoreScript( dest );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6285
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6286 // IE6-10 improperly clones children of object elements using classid.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6287 // IE10 throws NoModificationAllowedError if parent is null, #12132.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6288 } else if ( nodeName === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6289 if ( dest.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6290 dest.outerHTML = src.outerHTML;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6291 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6292
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6293 // This path appears unavoidable for IE9. When cloning an object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6294 // element in IE9, the outerHTML strategy above is not sufficient.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6295 // If the src has innerHTML and the destination does not,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6296 // copy the src.innerHTML into the dest.innerHTML. #10324
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6297 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6298 dest.innerHTML = src.innerHTML;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6299 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6300
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6301 } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6302 // IE6-8 fails to persist the checked state of a cloned checkbox
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6303 // or radio button. Worse, IE6-7 fail to give the cloned element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6304 // a checked appearance if the defaultChecked value isn't also set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6305
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6306 dest.defaultChecked = dest.checked = src.checked;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6307
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6308 // IE6-7 get confused and end up setting the value of a cloned
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6309 // checkbox/radio button to an empty string instead of "on"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6310 if ( dest.value !== src.value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6311 dest.value = src.value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6312 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6313
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6314 // IE6-8 fails to return the selected option to the default selected
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6315 // state when cloning options
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6316 } else if ( nodeName === "option" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6317 dest.defaultSelected = dest.selected = src.defaultSelected;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6318
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6319 // IE6-8 fails to set the defaultValue to the correct value when
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6320 // cloning other types of input fields
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6321 } else if ( nodeName === "input" || nodeName === "textarea" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6322 dest.defaultValue = src.defaultValue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6323 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6324 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6325
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6326 jQuery.each({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6327 appendTo: "append",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6328 prependTo: "prepend",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6329 insertBefore: "before",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6330 insertAfter: "after",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6331 replaceAll: "replaceWith"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6332 }, function( name, original ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6333 jQuery.fn[ name ] = function( selector ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6334 var elems,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6335 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6336 ret = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6337 insert = jQuery( selector ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6338 last = insert.length - 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6339
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6340 for ( ; i <= last; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6341 elems = i === last ? this : this.clone(true);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6342 jQuery( insert[i] )[ original ]( elems );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6343
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6344 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6345 core_push.apply( ret, elems.get() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6346 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6347
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6348 return this.pushStack( ret );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6349 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6350 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6351
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6352 function getAll( context, tag ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6353 var elems, elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6354 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6355 found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6356 typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6357 undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6358
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6359 if ( !found ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6360 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6361 if ( !tag || jQuery.nodeName( elem, tag ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6362 found.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6363 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6364 jQuery.merge( found, getAll( elem, tag ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6365 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6366 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6367 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6368
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6369 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6370 jQuery.merge( [ context ], found ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6371 found;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6372 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6373
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6374 // Used in buildFragment, fixes the defaultChecked property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6375 function fixDefaultChecked( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6376 if ( manipulation_rcheckableType.test( elem.type ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6377 elem.defaultChecked = elem.checked;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6378 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6379 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6380
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6381 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6382 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6383 var destElements, node, clone, i, srcElements,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6384 inPage = jQuery.contains( elem.ownerDocument, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6385
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6386 if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6387 clone = elem.cloneNode( true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6388
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6389 // IE<=8 does not properly clone detached, unknown element nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6390 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6391 fragmentDiv.innerHTML = elem.outerHTML;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6392 fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6393 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6394
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6395 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6396 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6397
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6398 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6399 destElements = getAll( clone );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6400 srcElements = getAll( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6401
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6402 // Fix all IE cloning issues
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6403 for ( i = 0; (node = srcElements[i]) != null; ++i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6404 // Ensure that the destination node is not null; Fixes #9587
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6405 if ( destElements[i] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6406 fixCloneNodeIssues( node, destElements[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6407 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6408 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6409 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6410
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6411 // Copy the events from the original to the clone
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6412 if ( dataAndEvents ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6413 if ( deepDataAndEvents ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6414 srcElements = srcElements || getAll( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6415 destElements = destElements || getAll( clone );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6416
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6417 for ( i = 0; (node = srcElements[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6418 cloneCopyEvent( node, destElements[i] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6419 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6420 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6421 cloneCopyEvent( elem, clone );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6422 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6423 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6424
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6425 // Preserve script evaluation history
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6426 destElements = getAll( clone, "script" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6427 if ( destElements.length > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6428 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6429 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6430
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6431 destElements = srcElements = node = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6432
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6433 // Return the cloned set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6434 return clone;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6435 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6436
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6437 buildFragment: function( elems, context, scripts, selection ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6438 var j, elem, contains,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6439 tmp, tag, tbody, wrap,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6440 l = elems.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6441
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6442 // Ensure a safe fragment
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6443 safe = createSafeFragment( context ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6444
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6445 nodes = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6446 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6447
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6448 for ( ; i < l; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6449 elem = elems[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6450
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6451 if ( elem || elem === 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6452
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6453 // Add nodes directly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6454 if ( jQuery.type( elem ) === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6455 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6456
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6457 // Convert non-html into a text node
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6458 } else if ( !rhtml.test( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6459 nodes.push( context.createTextNode( elem ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6460
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6461 // Convert html into DOM nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6462 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6463 tmp = tmp || safe.appendChild( context.createElement("div") );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6464
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6465 // Deserialize a standard representation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6466 tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6467 wrap = wrapMap[ tag ] || wrapMap._default;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6468
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6469 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6470
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6471 // Descend through wrappers to the right content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6472 j = wrap[0];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6473 while ( j-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6474 tmp = tmp.lastChild;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6475 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6476
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6477 // Manually add leading whitespace removed by IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6478 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6479 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6480 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6481
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6482 // Remove IE's autoinserted <tbody> from table fragments
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6483 if ( !jQuery.support.tbody ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6484
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6485 // String was a <table>, *may* have spurious <tbody>
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6486 elem = tag === "table" && !rtbody.test( elem ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6487 tmp.firstChild :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6488
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6489 // String was a bare <thead> or <tfoot>
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6490 wrap[1] === "<table>" && !rtbody.test( elem ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6491 tmp :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6492 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6493
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6494 j = elem && elem.childNodes.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6495 while ( j-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6496 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6497 elem.removeChild( tbody );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6498 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6499 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6500 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6501
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6502 jQuery.merge( nodes, tmp.childNodes );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6503
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6504 // Fix #12392 for WebKit and IE > 9
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6505 tmp.textContent = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6506
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6507 // Fix #12392 for oldIE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6508 while ( tmp.firstChild ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6509 tmp.removeChild( tmp.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6510 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6511
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6512 // Remember the top-level container for proper cleanup
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6513 tmp = safe.lastChild;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6514 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6515 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6516 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6517
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6518 // Fix #11356: Clear elements from fragment
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6519 if ( tmp ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6520 safe.removeChild( tmp );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6521 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6522
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6523 // Reset defaultChecked for any radios and checkboxes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6524 // about to be appended to the DOM in IE 6/7 (#8060)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6525 if ( !jQuery.support.appendChecked ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6526 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6527 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6528
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6529 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6530 while ( (elem = nodes[ i++ ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6531
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6532 // #4087 - If origin and destination elements are the same, and this is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6533 // that element, do not do anything
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6534 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6535 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6536 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6537
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6538 contains = jQuery.contains( elem.ownerDocument, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6539
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6540 // Append to fragment
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6541 tmp = getAll( safe.appendChild( elem ), "script" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6542
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6543 // Preserve script evaluation history
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6544 if ( contains ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6545 setGlobalEval( tmp );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6546 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6547
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6548 // Capture executables
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6549 if ( scripts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6550 j = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6551 while ( (elem = tmp[ j++ ]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6552 if ( rscriptType.test( elem.type || "" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6553 scripts.push( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6554 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6555 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6556 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6557 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6558
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6559 tmp = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6560
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6561 return safe;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6562 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6563
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6564 cleanData: function( elems, /* internal */ acceptData ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6565 var elem, type, id, data,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6566 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6567 internalKey = jQuery.expando,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6568 cache = jQuery.cache,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6569 deleteExpando = jQuery.support.deleteExpando,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6570 special = jQuery.event.special;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6571
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6572 for ( ; (elem = elems[i]) != null; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6573
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6574 if ( acceptData || jQuery.acceptData( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6575
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6576 id = elem[ internalKey ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6577 data = id && cache[ id ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6578
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6579 if ( data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6580 if ( data.events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6581 for ( type in data.events ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6582 if ( special[ type ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6583 jQuery.event.remove( elem, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6584
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6585 // This is a shortcut to avoid jQuery.event.remove's overhead
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6586 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6587 jQuery.removeEvent( elem, type, data.handle );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6588 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6589 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6590 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6591
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6592 // Remove cache only if it was not already removed by jQuery.event.remove
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6593 if ( cache[ id ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6594
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6595 delete cache[ id ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6596
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6597 // IE does not allow us to delete expando properties from nodes,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6598 // nor does it have a removeAttribute function on Document nodes;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6599 // we must handle all of these cases
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6600 if ( deleteExpando ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6601 delete elem[ internalKey ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6602
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6603 } else if ( typeof elem.removeAttribute !== core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6604 elem.removeAttribute( internalKey );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6605
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6606 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6607 elem[ internalKey ] = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6608 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6609
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6610 core_deletedIds.push( id );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6611 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6612 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6613 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6614 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6615 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6616 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6617 var iframe, getStyles, curCSS,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6618 ralpha = /alpha\([^)]*\)/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6619 ropacity = /opacity\s*=\s*([^)]*)/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6620 rposition = /^(top|right|bottom|left)$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6621 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6622 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6623 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6624 rmargin = /^margin/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6625 rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6626 rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6627 rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6628 elemdisplay = { BODY: "block" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6629
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6630 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6631 cssNormalTransform = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6632 letterSpacing: 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6633 fontWeight: 400
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6634 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6635
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6636 cssExpand = [ "Top", "Right", "Bottom", "Left" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6637 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6638
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6639 // return a css property mapped to a potentially vendor prefixed property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6640 function vendorPropName( style, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6641
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6642 // shortcut for names that are not vendor prefixed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6643 if ( name in style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6644 return name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6645 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6646
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6647 // check for vendor prefixed names
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6648 var capName = name.charAt(0).toUpperCase() + name.slice(1),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6649 origName = name,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6650 i = cssPrefixes.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6651
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6652 while ( i-- ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6653 name = cssPrefixes[ i ] + capName;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6654 if ( name in style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6655 return name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6656 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6657 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6658
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6659 return origName;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6660 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6661
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6662 function isHidden( elem, el ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6663 // isHidden might be called from jQuery#filter function;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6664 // in that case, element will be second argument
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6665 elem = el || elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6666 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6667 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6668
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6669 function showHide( elements, show ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6670 var display, elem, hidden,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6671 values = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6672 index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6673 length = elements.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6674
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6675 for ( ; index < length; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6676 elem = elements[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6677 if ( !elem.style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6678 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6679 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6680
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6681 values[ index ] = jQuery._data( elem, "olddisplay" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6682 display = elem.style.display;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6683 if ( show ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6684 // Reset the inline display of this element to learn if it is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6685 // being hidden by cascaded rules or not
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6686 if ( !values[ index ] && display === "none" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6687 elem.style.display = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6688 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6689
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6690 // Set elements which have been overridden with display: none
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6691 // in a stylesheet to whatever the default browser style is
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6692 // for such an element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6693 if ( elem.style.display === "" && isHidden( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6694 values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6695 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6696 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6697
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6698 if ( !values[ index ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6699 hidden = isHidden( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6700
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6701 if ( display && display !== "none" || !hidden ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6702 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6703 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6704 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6705 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6706 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6707
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6708 // Set the display of most of the elements in a second loop
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6709 // to avoid the constant reflow
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6710 for ( index = 0; index < length; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6711 elem = elements[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6712 if ( !elem.style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6713 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6714 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6715 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6716 elem.style.display = show ? values[ index ] || "" : "none";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6717 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6718 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6719
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6720 return elements;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6721 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6722
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6723 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6724 css: function( name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6725 return jQuery.access( this, function( elem, name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6726 var len, styles,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6727 map = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6728 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6729
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6730 if ( jQuery.isArray( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6731 styles = getStyles( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6732 len = name.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6733
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6734 for ( ; i < len; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6735 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6736 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6737
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6738 return map;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6739 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6740
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6741 return value !== undefined ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6742 jQuery.style( elem, name, value ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6743 jQuery.css( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6744 }, name, value, arguments.length > 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6745 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6746 show: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6747 return showHide( this, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6748 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6749 hide: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6750 return showHide( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6751 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6752 toggle: function( state ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6753 var bool = typeof state === "boolean";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6754
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6755 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6756 if ( bool ? state : isHidden( this ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6757 jQuery( this ).show();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6758 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6759 jQuery( this ).hide();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6760 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6761 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6762 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6763 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6764
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6765 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6766 // Add in style property hooks for overriding the default
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6767 // behavior of getting and setting a style property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6768 cssHooks: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6769 opacity: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6770 get: function( elem, computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6771 if ( computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6772 // We should always get a number back from opacity
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6773 var ret = curCSS( elem, "opacity" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6774 return ret === "" ? "1" : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6775 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6776 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6777 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6778 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6779
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6780 // Exclude the following css properties to add px
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6781 cssNumber: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6782 "columnCount": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6783 "fillOpacity": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6784 "fontWeight": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6785 "lineHeight": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6786 "opacity": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6787 "orphans": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6788 "widows": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6789 "zIndex": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6790 "zoom": true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6791 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6792
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6793 // Add in properties whose names you wish to fix before
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6794 // setting or getting the value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6795 cssProps: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6796 // normalize float css property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6797 "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6798 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6799
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6800 // Get and set the style property on a DOM Node
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6801 style: function( elem, name, value, extra ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6802 // Don't set styles on text and comment nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6803 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6804 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6805 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6806
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6807 // Make sure that we're working with the right name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6808 var ret, type, hooks,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6809 origName = jQuery.camelCase( name ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6810 style = elem.style;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6811
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6812 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6813
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6814 // gets hook for the prefixed version
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6815 // followed by the unprefixed version
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6816 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6817
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6818 // Check if we're setting a value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6819 if ( value !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6820 type = typeof value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6821
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6822 // convert relative number strings (+= or -=) to relative numbers. #7345
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6823 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6824 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6825 // Fixes bug #9237
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6826 type = "number";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6827 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6828
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6829 // Make sure that NaN and null values aren't set. See: #7116
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6830 if ( value == null || type === "number" && isNaN( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6831 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6832 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6833
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6834 // If a number was passed in, add 'px' to the (except for certain CSS properties)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6835 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6836 value += "px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6837 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6838
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6839 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6840 // but it would mean to define eight (for every problematic property) identical functions
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6841 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6842 style[ name ] = "inherit";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6843 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6844
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6845 // If a hook was provided, use that value, otherwise just set the specified value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6846 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6847
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6848 // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6849 // Fixes bug #5509
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6850 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6851 style[ name ] = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6852 } catch(e) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6853 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6854
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6855 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6856 // If a hook was provided get the non-computed value from there
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6857 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6858 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6859 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6860
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6861 // Otherwise just get the value from the style object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6862 return style[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6863 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6864 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6865
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6866 css: function( elem, name, extra, styles ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6867 var num, val, hooks,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6868 origName = jQuery.camelCase( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6869
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6870 // Make sure that we're working with the right name
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6871 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6872
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6873 // gets hook for the prefixed version
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6874 // followed by the unprefixed version
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6875 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6876
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6877 // If a hook was provided get the computed value from there
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6878 if ( hooks && "get" in hooks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6879 val = hooks.get( elem, true, extra );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6880 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6881
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6882 // Otherwise, if a way to get the computed value exists, use that
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6883 if ( val === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6884 val = curCSS( elem, name, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6885 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6886
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6887 //convert "normal" to computed value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6888 if ( val === "normal" && name in cssNormalTransform ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6889 val = cssNormalTransform[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6890 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6891
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6892 // Return, converting to number if forced or a qualifier was provided and val looks numeric
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6893 if ( extra === "" || extra ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6894 num = parseFloat( val );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6895 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6896 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6897 return val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6898 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6899
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6900 // A method for quickly swapping in/out CSS properties to get correct calculations
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6901 swap: function( elem, options, callback, args ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6902 var ret, name,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6903 old = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6904
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6905 // Remember the old values, and insert the new ones
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6906 for ( name in options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6907 old[ name ] = elem.style[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6908 elem.style[ name ] = options[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6909 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6910
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6911 ret = callback.apply( elem, args || [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6912
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6913 // Revert the old values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6914 for ( name in options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6915 elem.style[ name ] = old[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6916 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6917
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6918 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6919 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6920 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6921
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6922 // NOTE: we've included the "window" in window.getComputedStyle
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6923 // because jsdom on node.js will break without it.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6924 if ( window.getComputedStyle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6925 getStyles = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6926 return window.getComputedStyle( elem, null );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6927 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6928
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6929 curCSS = function( elem, name, _computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6930 var width, minWidth, maxWidth,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6931 computed = _computed || getStyles( elem ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6932
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6933 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6934 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6935 style = elem.style;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6936
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6937 if ( computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6938
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6939 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6940 ret = jQuery.style( elem, name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6941 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6942
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6943 // A tribute to the "awesome hack by Dean Edwards"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6944 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6945 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6946 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6947 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6948
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6949 // Remember the original values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6950 width = style.width;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6951 minWidth = style.minWidth;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6952 maxWidth = style.maxWidth;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6953
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6954 // Put in the new values to get a computed value out
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6955 style.minWidth = style.maxWidth = style.width = ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6956 ret = computed.width;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6957
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6958 // Revert the changed values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6959 style.width = width;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6960 style.minWidth = minWidth;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6961 style.maxWidth = maxWidth;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6962 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6963 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6964
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6965 return ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6966 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6967 } else if ( document.documentElement.currentStyle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6968 getStyles = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6969 return elem.currentStyle;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6970 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6971
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6972 curCSS = function( elem, name, _computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6973 var left, rs, rsLeft,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6974 computed = _computed || getStyles( elem ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6975 ret = computed ? computed[ name ] : undefined,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6976 style = elem.style;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6977
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6978 // Avoid setting ret to empty string here
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6979 // so we don't default to auto
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6980 if ( ret == null && style && style[ name ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6981 ret = style[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6982 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6983
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6984 // From the awesome hack by Dean Edwards
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6985 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6986
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6987 // If we're not dealing with a regular pixel number
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6988 // but a number that has a weird ending, we need to convert it to pixels
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6989 // but not position css attributes, as those are proportional to the parent element instead
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6990 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6991 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6992
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6993 // Remember the original values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6994 left = style.left;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6995 rs = elem.runtimeStyle;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6996 rsLeft = rs && rs.left;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6997
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6998 // Put in the new values to get a computed value out
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6999 if ( rsLeft ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7000 rs.left = elem.currentStyle.left;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7001 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7002 style.left = name === "fontSize" ? "1em" : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7003 ret = style.pixelLeft + "px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7004
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7005 // Revert the changed values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7006 style.left = left;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7007 if ( rsLeft ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7008 rs.left = rsLeft;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7009 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7010 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7011
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7012 return ret === "" ? "auto" : ret;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7013 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7014 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7015
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7016 function setPositiveNumber( elem, value, subtract ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7017 var matches = rnumsplit.exec( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7018 return matches ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7019 // Guard against undefined "subtract", e.g., when used as in cssHooks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7020 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7021 value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7022 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7023
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7024 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7025 var i = extra === ( isBorderBox ? "border" : "content" ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7026 // If we already have the right measurement, avoid augmentation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7027 4 :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7028 // Otherwise initialize for horizontal or vertical properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7029 name === "width" ? 1 : 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7030
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7031 val = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7032
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7033 for ( ; i < 4; i += 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7034 // both box models exclude margin, so add it if we want it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7035 if ( extra === "margin" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7036 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7037 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7038
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7039 if ( isBorderBox ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7040 // border-box includes padding, so remove it if we want content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7041 if ( extra === "content" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7042 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7043 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7044
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7045 // at this point, extra isn't border nor margin, so remove border
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7046 if ( extra !== "margin" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7047 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7048 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7049 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7050 // at this point, extra isn't content, so add padding
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7051 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7052
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7053 // at this point, extra isn't content nor padding, so add border
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7054 if ( extra !== "padding" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7055 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7056 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7057 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7058 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7059
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7060 return val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7061 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7062
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7063 function getWidthOrHeight( elem, name, extra ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7064
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7065 // Start with offset property, which is equivalent to the border-box value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7066 var valueIsBorderBox = true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7067 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7068 styles = getStyles( elem ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7069 isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7070
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7071 // some non-html elements return undefined for offsetWidth, so check for null/undefined
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7072 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7073 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7074 if ( val <= 0 || val == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7075 // Fall back to computed then uncomputed css if necessary
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7076 val = curCSS( elem, name, styles );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7077 if ( val < 0 || val == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7078 val = elem.style[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7079 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7080
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7081 // Computed unit is not pixels. Stop here and return.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7082 if ( rnumnonpx.test(val) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7083 return val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7084 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7085
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7086 // we need the check for style in case a browser which returns unreliable values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7087 // for getComputedStyle silently falls back to the reliable elem.style
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7088 valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7089
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7090 // Normalize "", auto, and prepare for extra
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7091 val = parseFloat( val ) || 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7092 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7093
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7094 // use the active box-sizing model to add/subtract irrelevant styles
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7095 return ( val +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7096 augmentWidthOrHeight(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7097 elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7098 name,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7099 extra || ( isBorderBox ? "border" : "content" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7100 valueIsBorderBox,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7101 styles
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7102 )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7103 ) + "px";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7104 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7105
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7106 // Try to determine the default display value of an element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7107 function css_defaultDisplay( nodeName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7108 var doc = document,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7109 display = elemdisplay[ nodeName ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7110
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7111 if ( !display ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7112 display = actualDisplay( nodeName, doc );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7113
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7114 // If the simple way fails, read from inside an iframe
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7115 if ( display === "none" || !display ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7116 // Use the already-created iframe if possible
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7117 iframe = ( iframe ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7118 jQuery("<iframe frameborder='0' width='0' height='0'/>")
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7119 .css( "cssText", "display:block !important" )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7120 ).appendTo( doc.documentElement );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7121
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7122 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7123 doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7124 doc.write("<!doctype html><html><body>");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7125 doc.close();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7126
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7127 display = actualDisplay( nodeName, doc );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7128 iframe.detach();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7129 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7130
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7131 // Store the correct default display
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7132 elemdisplay[ nodeName ] = display;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7133 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7134
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7135 return display;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7136 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7137
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7138 // Called ONLY from within css_defaultDisplay
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7139 function actualDisplay( name, doc ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7140 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7141 display = jQuery.css( elem[0], "display" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7142 elem.remove();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7143 return display;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7144 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7145
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7146 jQuery.each([ "height", "width" ], function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7147 jQuery.cssHooks[ name ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7148 get: function( elem, computed, extra ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7149 if ( computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7150 // certain elements can have dimension info if we invisibly show them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7151 // however, it must have a current display style that would benefit from this
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7152 return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7153 jQuery.swap( elem, cssShow, function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7154 return getWidthOrHeight( elem, name, extra );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7155 }) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7156 getWidthOrHeight( elem, name, extra );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7157 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7158 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7159
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7160 set: function( elem, value, extra ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7161 var styles = extra && getStyles( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7162 return setPositiveNumber( elem, value, extra ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7163 augmentWidthOrHeight(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7164 elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7165 name,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7166 extra,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7167 jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7168 styles
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7169 ) : 0
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7170 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7171 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7172 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7173 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7174
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7175 if ( !jQuery.support.opacity ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7176 jQuery.cssHooks.opacity = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7177 get: function( elem, computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7178 // IE uses filters for opacity
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7179 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7180 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7181 computed ? "1" : "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7182 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7183
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7184 set: function( elem, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7185 var style = elem.style,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7186 currentStyle = elem.currentStyle,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7187 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7188 filter = currentStyle && currentStyle.filter || style.filter || "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7189
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7190 // IE has trouble with opacity if it does not have layout
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7191 // Force it by setting the zoom level
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7192 style.zoom = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7193
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7194 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7195 // if value === "", then remove inline opacity #12685
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7196 if ( ( value >= 1 || value === "" ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7197 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7198 style.removeAttribute ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7199
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7200 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7201 // if "filter:" is present at all, clearType is disabled, we want to avoid this
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7202 // style.removeAttribute is IE Only, but so apparently is this code path...
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7203 style.removeAttribute( "filter" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7204
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7205 // if there is no filter style applied in a css rule or unset inline opacity, we are done
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7206 if ( value === "" || currentStyle && !currentStyle.filter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7207 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7208 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7209 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7210
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7211 // otherwise, set new filter values
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7212 style.filter = ralpha.test( filter ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7213 filter.replace( ralpha, opacity ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7214 filter + " " + opacity;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7215 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7216 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7217 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7218
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7219 // These hooks cannot be added until DOM ready because the support test
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7220 // for it is not run until after DOM ready
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7221 jQuery(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7222 if ( !jQuery.support.reliableMarginRight ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7223 jQuery.cssHooks.marginRight = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7224 get: function( elem, computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7225 if ( computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7226 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7227 // Work around by temporarily setting element display to inline-block
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7228 return jQuery.swap( elem, { "display": "inline-block" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7229 curCSS, [ elem, "marginRight" ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7230 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7231 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7232 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7233 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7234
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7235 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7236 // getComputedStyle returns percent when specified for top/left/bottom/right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7237 // rather than make the css module depend on the offset module, we just check for it here
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7238 if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7239 jQuery.each( [ "top", "left" ], function( i, prop ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7240 jQuery.cssHooks[ prop ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7241 get: function( elem, computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7242 if ( computed ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7243 computed = curCSS( elem, prop );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7244 // if curCSS returns percentage, fallback to offset
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7245 return rnumnonpx.test( computed ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7246 jQuery( elem ).position()[ prop ] + "px" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7247 computed;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7248 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7250 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7251 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7252 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7253
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7254 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7255
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7256 if ( jQuery.expr && jQuery.expr.filters ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7257 jQuery.expr.filters.hidden = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7258 // Support: Opera <= 12.12
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7259 // Opera reports offsetWidths and offsetHeights less than zero on some elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7260 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7261 (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7262 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7263
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7264 jQuery.expr.filters.visible = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7265 return !jQuery.expr.filters.hidden( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7266 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7267 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7268
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7269 // These hooks are used by animate to expand properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7270 jQuery.each({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7271 margin: "",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7272 padding: "",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7273 border: "Width"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7274 }, function( prefix, suffix ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7275 jQuery.cssHooks[ prefix + suffix ] = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7276 expand: function( value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7277 var i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7278 expanded = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7279
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7280 // assumes a single number if not a string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7281 parts = typeof value === "string" ? value.split(" ") : [ value ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7282
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7283 for ( ; i < 4; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7284 expanded[ prefix + cssExpand[ i ] + suffix ] =
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7285 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7286 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7287
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7288 return expanded;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7289 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7290 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7291
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7292 if ( !rmargin.test( prefix ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7293 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7294 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7295 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7296 var r20 = /%20/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7297 rbracket = /\[\]$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7298 rCRLF = /\r?\n/g,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7299 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7300 rsubmittable = /^(?:input|select|textarea|keygen)/i;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7301
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7302 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7303 serialize: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7304 return jQuery.param( this.serializeArray() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7305 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7306 serializeArray: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7307 return this.map(function(){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7308 // Can add propHook for "elements" to filter or add form elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7309 var elements = jQuery.prop( this, "elements" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7310 return elements ? jQuery.makeArray( elements ) : this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7311 })
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7312 .filter(function(){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7313 var type = this.type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7314 // Use .is(":disabled") so that fieldset[disabled] works
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7315 return this.name && !jQuery( this ).is( ":disabled" ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7316 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7317 ( this.checked || !manipulation_rcheckableType.test( type ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7318 })
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7319 .map(function( i, elem ){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7320 var val = jQuery( this ).val();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7321
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7322 return val == null ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7323 null :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7324 jQuery.isArray( val ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7325 jQuery.map( val, function( val ){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7326 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7327 }) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7328 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7329 }).get();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7330 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7331 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7332
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7333 //Serialize an array of form elements or a set of
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7334 //key/values into a query string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7335 jQuery.param = function( a, traditional ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7336 var prefix,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7337 s = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7338 add = function( key, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7339 // If value is a function, invoke it and return its value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7340 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7341 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7342 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7343
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7344 // Set traditional to true for jQuery <= 1.3.2 behavior.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7345 if ( traditional === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7346 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7347 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7348
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7349 // If an array was passed in, assume that it is an array of form elements.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7350 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7351 // Serialize the form elements
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7352 jQuery.each( a, function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7353 add( this.name, this.value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7354 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7355
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7356 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7357 // If traditional, encode the "old" way (the way 1.3.2 or older
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7358 // did it), otherwise encode params recursively.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7359 for ( prefix in a ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7360 buildParams( prefix, a[ prefix ], traditional, add );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7361 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7362 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7363
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7364 // Return the resulting serialization
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7365 return s.join( "&" ).replace( r20, "+" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7366 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7367
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7368 function buildParams( prefix, obj, traditional, add ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7369 var name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7370
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7371 if ( jQuery.isArray( obj ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7372 // Serialize array item.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7373 jQuery.each( obj, function( i, v ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7374 if ( traditional || rbracket.test( prefix ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7375 // Treat each array item as a scalar.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7376 add( prefix, v );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7377
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7378 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7379 // Item is non-scalar (array or object), encode its numeric index.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7380 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7381 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7382 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7383
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7384 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7385 // Serialize object item.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7386 for ( name in obj ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7387 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7388 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7389
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7390 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7391 // Serialize scalar item.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7392 add( prefix, obj );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7393 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7394 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7395 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7396 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7397 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7398
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7399 // Handle event binding
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7400 jQuery.fn[ name ] = function( data, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7401 return arguments.length > 0 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7402 this.on( name, null, data, fn ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7403 this.trigger( name );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7404 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7405 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7406
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7407 jQuery.fn.hover = function( fnOver, fnOut ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7408 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7409 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7410 var
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7411 // Document location
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7412 ajaxLocParts,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7413 ajaxLocation,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7414 ajax_nonce = jQuery.now(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7415
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7416 ajax_rquery = /\?/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7417 rhash = /#.*$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7418 rts = /([?&])_=[^&]*/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7419 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7420 // #7653, #8125, #8152: local protocol detection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7421 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7422 rnoContent = /^(?:GET|HEAD)$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7423 rprotocol = /^\/\//,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7424 rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7425
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7426 // Keep a copy of the old load method
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7427 _load = jQuery.fn.load,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7428
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7429 /* Prefilters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7430 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7431 * 2) These are called:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7432 * - BEFORE asking for a transport
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7433 * - AFTER param serialization (s.data is a string if s.processData is true)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7434 * 3) key is the dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7435 * 4) the catchall symbol "*" can be used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7436 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7437 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7438 prefilters = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7439
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7440 /* Transports bindings
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7441 * 1) key is the dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7442 * 2) the catchall symbol "*" can be used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7443 * 3) selection will start with transport dataType and THEN go to "*" if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7444 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7445 transports = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7446
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7447 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7448 allTypes = "*/".concat("*");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7449
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7450 // #8138, IE may throw an exception when accessing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7451 // a field from window.location if document.domain has been set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7452 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7453 ajaxLocation = location.href;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7454 } catch( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7455 // Use the href attribute of an A element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7456 // since IE will modify it given document.location
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7457 ajaxLocation = document.createElement( "a" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7458 ajaxLocation.href = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7459 ajaxLocation = ajaxLocation.href;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7460 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7461
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7462 // Segment location into parts
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7463 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7464
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7465 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7466 function addToPrefiltersOrTransports( structure ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7467
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7468 // dataTypeExpression is optional and defaults to "*"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7469 return function( dataTypeExpression, func ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7470
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7471 if ( typeof dataTypeExpression !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7472 func = dataTypeExpression;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7473 dataTypeExpression = "*";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7474 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7475
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7476 var dataType,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7477 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7478 dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7479
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7480 if ( jQuery.isFunction( func ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7481 // For each dataType in the dataTypeExpression
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7482 while ( (dataType = dataTypes[i++]) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7483 // Prepend if requested
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7484 if ( dataType[0] === "+" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7485 dataType = dataType.slice( 1 ) || "*";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7486 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7487
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7488 // Otherwise append
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7489 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7490 (structure[ dataType ] = structure[ dataType ] || []).push( func );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7491 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7492 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7493 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7494 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7495 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7496
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7497 // Base inspection function for prefilters and transports
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7498 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7499
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7500 var inspected = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7501 seekingTransport = ( structure === transports );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7502
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7503 function inspect( dataType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7504 var selected;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7505 inspected[ dataType ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7506 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7507 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7508 if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7509 options.dataTypes.unshift( dataTypeOrTransport );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7510 inspect( dataTypeOrTransport );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7511 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7512 } else if ( seekingTransport ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7513 return !( selected = dataTypeOrTransport );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7514 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7515 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7516 return selected;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7517 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7518
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7519 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7520 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7521
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7522 // A special extend for ajax options
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7523 // that takes "flat" options (not to be deep extended)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7524 // Fixes #9887
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7525 function ajaxExtend( target, src ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7526 var deep, key,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7527 flatOptions = jQuery.ajaxSettings.flatOptions || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7528
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7529 for ( key in src ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7530 if ( src[ key ] !== undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7531 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7532 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7533 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7534 if ( deep ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7535 jQuery.extend( true, target, deep );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7536 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7537
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7538 return target;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7539 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7540
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7541 jQuery.fn.load = function( url, params, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7542 if ( typeof url !== "string" && _load ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7543 return _load.apply( this, arguments );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7544 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7545
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7546 var selector, response, type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7547 self = this,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7548 off = url.indexOf(" ");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7549
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7550 if ( off >= 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7551 selector = url.slice( off, url.length );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7552 url = url.slice( 0, off );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7553 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7554
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7555 // If it's a function
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7556 if ( jQuery.isFunction( params ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7557
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7558 // We assume that it's the callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7559 callback = params;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7560 params = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7561
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7562 // Otherwise, build a param string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7563 } else if ( params && typeof params === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7564 type = "POST";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7565 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7566
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7567 // If we have elements to modify, make the request
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7568 if ( self.length > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7569 jQuery.ajax({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7570 url: url,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7571
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7572 // if "type" variable is undefined, then "GET" method will be used
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7573 type: type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7574 dataType: "html",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7575 data: params
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7576 }).done(function( responseText ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7577
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7578 // Save response for use in complete callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7579 response = arguments;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7580
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7581 self.html( selector ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7582
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7583 // If a selector was specified, locate the right elements in a dummy div
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7584 // Exclude scripts to avoid IE 'Permission Denied' errors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7585 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7586
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7587 // Otherwise use the full result
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7588 responseText );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7589
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7590 }).complete( callback && function( jqXHR, status ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7591 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7592 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7593 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7594
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7595 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7596 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7597
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7598 // Attach a bunch of functions for handling common AJAX events
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7599 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7600 jQuery.fn[ type ] = function( fn ){
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7601 return this.on( type, fn );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7602 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7603 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7604
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7605 jQuery.each( [ "get", "post" ], function( i, method ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7606 jQuery[ method ] = function( url, data, callback, type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7607 // shift arguments if data argument was omitted
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7608 if ( jQuery.isFunction( data ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7609 type = type || callback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7610 callback = data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7611 data = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7612 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7613
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7614 return jQuery.ajax({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7615 url: url,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7616 type: method,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7617 dataType: type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7618 data: data,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7619 success: callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7620 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7621 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7622 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7623
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7624 jQuery.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7625
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7626 // Counter for holding the number of active queries
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7627 active: 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7628
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7629 // Last-Modified header cache for next request
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7630 lastModified: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7631 etag: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7632
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7633 ajaxSettings: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7634 url: ajaxLocation,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7635 type: "GET",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7636 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7637 global: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7638 processData: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7639 async: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7640 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7641 /*
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7642 timeout: 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7643 data: null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7644 dataType: null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7645 username: null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7646 password: null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7647 cache: null,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7648 throws: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7649 traditional: false,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7650 headers: {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7651 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7652
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7653 accepts: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7654 "*": allTypes,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7655 text: "text/plain",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7656 html: "text/html",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7657 xml: "application/xml, text/xml",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7658 json: "application/json, text/javascript"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7659 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7660
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7661 contents: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7662 xml: /xml/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7663 html: /html/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7664 json: /json/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7665 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7666
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7667 responseFields: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7668 xml: "responseXML",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7669 text: "responseText"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7670 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7671
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7672 // Data converters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7673 // Keys separate source (or catchall "*") and destination types with a single space
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7674 converters: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7675
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7676 // Convert anything to text
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7677 "* text": window.String,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7678
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7679 // Text to html (true = no transformation)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7680 "text html": true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7681
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7682 // Evaluate text as a json expression
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7683 "text json": jQuery.parseJSON,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7684
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7685 // Parse text as xml
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7686 "text xml": jQuery.parseXML
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7687 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7688
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7689 // For options that shouldn't be deep extended:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7690 // you can add your own custom options here if
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7691 // and when you create one that shouldn't be
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7692 // deep extended (see ajaxExtend)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7693 flatOptions: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7694 url: true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7695 context: true
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7696 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7697 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7698
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7699 // Creates a full fledged settings object into target
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7700 // with both ajaxSettings and settings fields.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7701 // If target is omitted, writes into ajaxSettings.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7702 ajaxSetup: function( target, settings ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7703 return settings ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7704
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7705 // Building a settings object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7706 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7707
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7708 // Extending ajaxSettings
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7709 ajaxExtend( jQuery.ajaxSettings, target );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7710 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7711
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7712 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7713 ajaxTransport: addToPrefiltersOrTransports( transports ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7714
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7715 // Main method
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7716 ajax: function( url, options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7717
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7718 // If url is an object, simulate pre-1.5 signature
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7719 if ( typeof url === "object" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7720 options = url;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7721 url = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7722 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7723
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7724 // Force options to be an object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7725 options = options || {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7726
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7727 var // Cross-domain detection vars
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7728 parts,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7729 // Loop variable
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7730 i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7731 // URL without anti-cache param
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7732 cacheURL,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7733 // Response headers as string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7734 responseHeadersString,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7735 // timeout handle
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7736 timeoutTimer,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7737
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7738 // To know if global events are to be dispatched
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7739 fireGlobals,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7740
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7741 transport,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7742 // Response headers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7743 responseHeaders,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7744 // Create the final options object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7745 s = jQuery.ajaxSetup( {}, options ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7746 // Callbacks context
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7747 callbackContext = s.context || s,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7748 // Context for global events is callbackContext if it is a DOM node or jQuery collection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7749 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7750 jQuery( callbackContext ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7751 jQuery.event,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7752 // Deferreds
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7753 deferred = jQuery.Deferred(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7754 completeDeferred = jQuery.Callbacks("once memory"),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7755 // Status-dependent callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7756 statusCode = s.statusCode || {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7757 // Headers (they are sent all at once)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7758 requestHeaders = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7759 requestHeadersNames = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7760 // The jqXHR state
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7761 state = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7762 // Default abort message
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7763 strAbort = "canceled",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7764 // Fake xhr
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7765 jqXHR = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7766 readyState: 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7767
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7768 // Builds headers hashtable if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7769 getResponseHeader: function( key ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7770 var match;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7771 if ( state === 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7772 if ( !responseHeaders ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7773 responseHeaders = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7774 while ( (match = rheaders.exec( responseHeadersString )) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7775 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7776 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7777 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7778 match = responseHeaders[ key.toLowerCase() ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7779 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7780 return match == null ? null : match;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7781 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7782
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7783 // Raw string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7784 getAllResponseHeaders: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7785 return state === 2 ? responseHeadersString : null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7786 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7787
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7788 // Caches the header
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7789 setRequestHeader: function( name, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7790 var lname = name.toLowerCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7791 if ( !state ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7792 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7793 requestHeaders[ name ] = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7794 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7795 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7796 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7797
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7798 // Overrides response content-type header
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7799 overrideMimeType: function( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7800 if ( !state ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7801 s.mimeType = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7802 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7803 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7804 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7805
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7806 // Status-dependent callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7807 statusCode: function( map ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7808 var code;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7809 if ( map ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7810 if ( state < 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7811 for ( code in map ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7812 // Lazy-add the new callback in a way that preserves old ones
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7813 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7814 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7815 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7816 // Execute the appropriate callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7817 jqXHR.always( map[ jqXHR.status ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7818 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7819 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7820 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7821 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7823 // Cancel the request
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7824 abort: function( statusText ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7825 var finalText = statusText || strAbort;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7826 if ( transport ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7827 transport.abort( finalText );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7828 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7829 done( 0, finalText );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7830 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7831 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7832 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7833
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7834 // Attach deferreds
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7835 deferred.promise( jqXHR ).complete = completeDeferred.add;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7836 jqXHR.success = jqXHR.done;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7837 jqXHR.error = jqXHR.fail;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7838
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7839 // Remove hash character (#7531: and string promotion)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7840 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7841 // Handle falsy url in the settings object (#10093: consistency with old signature)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7842 // We also use the url parameter if available
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7843 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7844
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7845 // Alias method option to type as per ticket #12004
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7846 s.type = options.method || options.type || s.method || s.type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7847
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7848 // Extract dataTypes list
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7849 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7850
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7851 // A cross-domain request is in order when we have a protocol:host:port mismatch
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7852 if ( s.crossDomain == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7853 parts = rurl.exec( s.url.toLowerCase() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7854 s.crossDomain = !!( parts &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7855 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7856 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7857 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7858 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7859 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7860
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7861 // Convert data if not already a string
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7862 if ( s.data && s.processData && typeof s.data !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7863 s.data = jQuery.param( s.data, s.traditional );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7864 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7865
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7866 // Apply prefilters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7867 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7868
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7869 // If request was aborted inside a prefilter, stop there
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7870 if ( state === 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7871 return jqXHR;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7872 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7873
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7874 // We can fire global events as of now if asked to
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7875 fireGlobals = s.global;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7876
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7877 // Watch for a new set of requests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7878 if ( fireGlobals && jQuery.active++ === 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7879 jQuery.event.trigger("ajaxStart");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7880 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7881
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7882 // Uppercase the type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7883 s.type = s.type.toUpperCase();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7884
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7885 // Determine if request has content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7886 s.hasContent = !rnoContent.test( s.type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7887
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7888 // Save the URL in case we're toying with the If-Modified-Since
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7889 // and/or If-None-Match header later on
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7890 cacheURL = s.url;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7891
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7892 // More options handling for requests with no content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7893 if ( !s.hasContent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7894
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7895 // If data is available, append data to url
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7896 if ( s.data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7897 cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7898 // #9682: remove data so that it's not used in an eventual retry
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7899 delete s.data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7900 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7901
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7902 // Add anti-cache in url if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7903 if ( s.cache === false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7904 s.url = rts.test( cacheURL ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7905
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7906 // If there is already a '_' parameter, set its value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7907 cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7908
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7909 // Otherwise add one to the end
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7910 cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7911 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7912 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7913
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7914 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7915 if ( s.ifModified ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7916 if ( jQuery.lastModified[ cacheURL ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7917 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7918 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7919 if ( jQuery.etag[ cacheURL ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7920 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7921 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7922 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7923
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7924 // Set the correct header, if data is being sent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7925 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7926 jqXHR.setRequestHeader( "Content-Type", s.contentType );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7927 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7928
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7929 // Set the Accepts header for the server, depending on the dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7930 jqXHR.setRequestHeader(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7931 "Accept",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7932 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7933 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7934 s.accepts[ "*" ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7935 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7936
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7937 // Check for headers option
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7938 for ( i in s.headers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7939 jqXHR.setRequestHeader( i, s.headers[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7940 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7941
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7942 // Allow custom headers/mimetypes and early abort
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7943 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7944 // Abort if not done already and return
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7945 return jqXHR.abort();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7946 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7947
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7948 // aborting is no longer a cancellation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7949 strAbort = "abort";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7950
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7951 // Install callbacks on deferreds
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7952 for ( i in { success: 1, error: 1, complete: 1 } ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7953 jqXHR[ i ]( s[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7954 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7955
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7956 // Get transport
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7957 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7958
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7959 // If no transport, we auto-abort
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7960 if ( !transport ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7961 done( -1, "No Transport" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7962 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7963 jqXHR.readyState = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7964
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7965 // Send global event
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7966 if ( fireGlobals ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7967 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7968 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7969 // Timeout
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7970 if ( s.async && s.timeout > 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7971 timeoutTimer = setTimeout(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7972 jqXHR.abort("timeout");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7973 }, s.timeout );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7974 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7975
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7976 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7977 state = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7978 transport.send( requestHeaders, done );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7979 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7980 // Propagate exception as error if not done
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7981 if ( state < 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7982 done( -1, e );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7983 // Simply rethrow otherwise
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7984 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7985 throw e;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7986 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7987 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7988 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7989
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7990 // Callback for when everything is done
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7991 function done( status, nativeStatusText, responses, headers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7992 var isSuccess, success, error, response, modified,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7993 statusText = nativeStatusText;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7994
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7995 // Called once
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7996 if ( state === 2 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7997 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7998 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7999
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8000 // State is "done" now
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8001 state = 2;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8002
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8003 // Clear timeout if it exists
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8004 if ( timeoutTimer ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8005 clearTimeout( timeoutTimer );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8006 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8007
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8008 // Dereference transport for early garbage collection
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8009 // (no matter how long the jqXHR object will be used)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8010 transport = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8011
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8012 // Cache response headers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8013 responseHeadersString = headers || "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8014
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8015 // Set readyState
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8016 jqXHR.readyState = status > 0 ? 4 : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8017
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8018 // Get response data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8019 if ( responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8020 response = ajaxHandleResponses( s, jqXHR, responses );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8021 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8022
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8023 // If successful, handle type chaining
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8024 if ( status >= 200 && status < 300 || status === 304 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8025
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8026 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8027 if ( s.ifModified ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8028 modified = jqXHR.getResponseHeader("Last-Modified");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8029 if ( modified ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8030 jQuery.lastModified[ cacheURL ] = modified;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8031 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8032 modified = jqXHR.getResponseHeader("etag");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8033 if ( modified ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8034 jQuery.etag[ cacheURL ] = modified;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8035 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8036 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8037
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8038 // if no content
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8039 if ( status === 204 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8040 isSuccess = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8041 statusText = "nocontent";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8042
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8043 // if not modified
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8044 } else if ( status === 304 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8045 isSuccess = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8046 statusText = "notmodified";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8047
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8048 // If we have data, let's convert it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8049 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8050 isSuccess = ajaxConvert( s, response );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8051 statusText = isSuccess.state;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8052 success = isSuccess.data;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8053 error = isSuccess.error;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8054 isSuccess = !error;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8055 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8056 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8057 // We extract error from statusText
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8058 // then normalize statusText and status for non-aborts
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8059 error = statusText;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8060 if ( status || !statusText ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8061 statusText = "error";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8062 if ( status < 0 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8063 status = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8064 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8065 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8066 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8067
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8068 // Set data for the fake xhr object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8069 jqXHR.status = status;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8070 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8071
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8072 // Success/Error
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8073 if ( isSuccess ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8074 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8075 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8076 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8077 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8078
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8079 // Status-dependent callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8080 jqXHR.statusCode( statusCode );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8081 statusCode = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8082
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8083 if ( fireGlobals ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8084 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8085 [ jqXHR, s, isSuccess ? success : error ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8086 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8087
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8088 // Complete
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8089 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8090
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8091 if ( fireGlobals ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8092 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8093 // Handle the global AJAX counter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8094 if ( !( --jQuery.active ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8095 jQuery.event.trigger("ajaxStop");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8096 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8097 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8098 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8099
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8100 return jqXHR;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8101 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8102
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8103 getScript: function( url, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8104 return jQuery.get( url, undefined, callback, "script" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8105 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8106
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8107 getJSON: function( url, data, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8108 return jQuery.get( url, data, callback, "json" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8109 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8110 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8111
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8112 /* Handles responses to an ajax request:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8113 * - sets all responseXXX fields accordingly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8114 * - finds the right dataType (mediates between content-type and expected dataType)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8115 * - returns the corresponding response
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8116 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8117 function ajaxHandleResponses( s, jqXHR, responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8118 var firstDataType, ct, finalDataType, type,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8119 contents = s.contents,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8120 dataTypes = s.dataTypes,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8121 responseFields = s.responseFields;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8122
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8123 // Fill responseXXX fields
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8124 for ( type in responseFields ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8125 if ( type in responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8126 jqXHR[ responseFields[type] ] = responses[ type ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8127 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8128 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8129
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8130 // Remove auto dataType and get content-type in the process
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8131 while( dataTypes[ 0 ] === "*" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8132 dataTypes.shift();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8133 if ( ct === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8134 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8135 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8136 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8137
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8138 // Check if we're dealing with a known content-type
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8139 if ( ct ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8140 for ( type in contents ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8141 if ( contents[ type ] && contents[ type ].test( ct ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8142 dataTypes.unshift( type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8143 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8144 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8145 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8146 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8147
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8148 // Check to see if we have a response for the expected dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8149 if ( dataTypes[ 0 ] in responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8150 finalDataType = dataTypes[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8151 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8152 // Try convertible dataTypes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8153 for ( type in responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8154 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8155 finalDataType = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8156 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8157 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8158 if ( !firstDataType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8159 firstDataType = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8160 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8161 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8162 // Or just use first one
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8163 finalDataType = finalDataType || firstDataType;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8164 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8165
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8166 // If we found a dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8167 // We add the dataType to the list if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8168 // and return the corresponding response
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8169 if ( finalDataType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8170 if ( finalDataType !== dataTypes[ 0 ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8171 dataTypes.unshift( finalDataType );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8172 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8173 return responses[ finalDataType ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8174 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8175 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8176
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8177 // Chain conversions given the request and the original response
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8178 function ajaxConvert( s, response ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8179 var conv2, current, conv, tmp,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8180 converters = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8181 i = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8182 // Work with a copy of dataTypes in case we need to modify it for conversion
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8183 dataTypes = s.dataTypes.slice(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8184 prev = dataTypes[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8185
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8186 // Apply the dataFilter if provided
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8187 if ( s.dataFilter ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8188 response = s.dataFilter( response, s.dataType );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8189 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8190
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8191 // Create converters map with lowercased keys
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8192 if ( dataTypes[ 1 ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8193 for ( conv in s.converters ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8194 converters[ conv.toLowerCase() ] = s.converters[ conv ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8195 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8196 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8197
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8198 // Convert to each sequential dataType, tolerating list modification
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8199 for ( ; (current = dataTypes[++i]); ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8200
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8201 // There's only work to do if current dataType is non-auto
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8202 if ( current !== "*" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8203
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8204 // Convert response if prev dataType is non-auto and differs from current
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8205 if ( prev !== "*" && prev !== current ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8206
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8207 // Seek a direct converter
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8208 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8209
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8210 // If none found, seek a pair
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8211 if ( !conv ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8212 for ( conv2 in converters ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8213
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8214 // If conv2 outputs current
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8215 tmp = conv2.split(" ");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8216 if ( tmp[ 1 ] === current ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8217
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8218 // If prev can be converted to accepted input
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8219 conv = converters[ prev + " " + tmp[ 0 ] ] ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8220 converters[ "* " + tmp[ 0 ] ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8221 if ( conv ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8222 // Condense equivalence converters
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8223 if ( conv === true ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8224 conv = converters[ conv2 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8225
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8226 // Otherwise, insert the intermediate dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8227 } else if ( converters[ conv2 ] !== true ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8228 current = tmp[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8229 dataTypes.splice( i--, 0, current );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8230 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8231
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8232 break;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8233 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8234 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8235 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8236 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8237
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8238 // Apply converter (if not an equivalence)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8239 if ( conv !== true ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8240
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8241 // Unless errors are allowed to bubble, catch and return them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8242 if ( conv && s["throws"] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8243 response = conv( response );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8244 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8245 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8246 response = conv( response );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8247 } catch ( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8248 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8249 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8250 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8251 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8252 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8253
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8254 // Update prev for next iteration
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8255 prev = current;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8256 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8257 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8258
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8259 return { state: "success", data: response };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8260 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8261 // Install script dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8262 jQuery.ajaxSetup({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8263 accepts: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8264 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8265 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8266 contents: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8267 script: /(?:java|ecma)script/
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8268 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8269 converters: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8270 "text script": function( text ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8271 jQuery.globalEval( text );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8272 return text;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8273 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8274 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8275 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8276
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8277 // Handle cache's special case and global
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8278 jQuery.ajaxPrefilter( "script", function( s ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8279 if ( s.cache === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8280 s.cache = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8281 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8282 if ( s.crossDomain ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8283 s.type = "GET";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8284 s.global = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8285 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8286 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8287
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8288 // Bind script tag hack transport
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8289 jQuery.ajaxTransport( "script", function(s) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8290
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8291 // This transport only deals with cross domain requests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8292 if ( s.crossDomain ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8293
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8294 var script,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8295 head = document.head || jQuery("head")[0] || document.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8296
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8297 return {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8298
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8299 send: function( _, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8300
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8301 script = document.createElement("script");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8302
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8303 script.async = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8304
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8305 if ( s.scriptCharset ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8306 script.charset = s.scriptCharset;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8307 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8308
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8309 script.src = s.url;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8310
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8311 // Attach handlers for all browsers
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8312 script.onload = script.onreadystatechange = function( _, isAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8313
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8314 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8315
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8316 // Handle memory leak in IE
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8317 script.onload = script.onreadystatechange = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8318
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8319 // Remove the script
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8320 if ( script.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8321 script.parentNode.removeChild( script );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8322 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8323
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8324 // Dereference the script
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8325 script = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8326
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8327 // Callback if not abort
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8328 if ( !isAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8329 callback( 200, "success" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8330 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8331 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8332 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8333
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8334 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8335 // Use native DOM manipulation to avoid our domManip AJAX trickery
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8336 head.insertBefore( script, head.firstChild );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8337 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8338
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8339 abort: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8340 if ( script ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8341 script.onload( undefined, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8342 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8343 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8344 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8345 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8346 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8347 var oldCallbacks = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8348 rjsonp = /(=)\?(?=&|$)|\?\?/;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8349
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8350 // Default jsonp settings
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8351 jQuery.ajaxSetup({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8352 jsonp: "callback",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8353 jsonpCallback: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8354 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8355 this[ callback ] = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8356 return callback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8357 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8358 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8359
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8360 // Detect, normalize options and install callbacks for jsonp requests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8361 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8362
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8363 var callbackName, overwritten, responseContainer,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8364 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8365 "url" :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8366 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8367 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8368
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8369 // Handle iff the expected data type is "jsonp" or we have a parameter to set
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8370 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8371
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8372 // Get callback name, remembering preexisting value associated with it
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8373 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8374 s.jsonpCallback() :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8375 s.jsonpCallback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8376
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8377 // Insert callback into url or form data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8378 if ( jsonProp ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8379 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8380 } else if ( s.jsonp !== false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8381 s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8382 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8383
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8384 // Use data converter to retrieve json after script execution
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8385 s.converters["script json"] = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8386 if ( !responseContainer ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8387 jQuery.error( callbackName + " was not called" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8388 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8389 return responseContainer[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8390 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8391
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8392 // force json dataType
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8393 s.dataTypes[ 0 ] = "json";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8394
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8395 // Install callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8396 overwritten = window[ callbackName ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8397 window[ callbackName ] = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8398 responseContainer = arguments;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8399 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8400
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8401 // Clean-up function (fires after converters)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8402 jqXHR.always(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8403 // Restore preexisting value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8404 window[ callbackName ] = overwritten;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8405
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8406 // Save back as free
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8407 if ( s[ callbackName ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8408 // make sure that re-using the options doesn't screw things around
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8409 s.jsonpCallback = originalSettings.jsonpCallback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8410
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8411 // save the callback name for future use
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8412 oldCallbacks.push( callbackName );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8413 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8414
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8415 // Call if it was a function and we have a response
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8416 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8417 overwritten( responseContainer[ 0 ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8418 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8419
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8420 responseContainer = overwritten = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8421 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8422
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8423 // Delegate to script
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8424 return "script";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8425 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8426 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8427 var xhrCallbacks, xhrSupported,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8428 xhrId = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8429 // #5280: Internet Explorer will keep connections alive if we don't abort on unload
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8430 xhrOnUnloadAbort = window.ActiveXObject && function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8431 // Abort all pending requests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8432 var key;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8433 for ( key in xhrCallbacks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8434 xhrCallbacks[ key ]( undefined, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8435 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8436 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8437
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8438 // Functions to create xhrs
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8439 function createStandardXHR() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8440 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8441 return new window.XMLHttpRequest();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8442 } catch( e ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8443 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8444
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8445 function createActiveXHR() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8446 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8447 return new window.ActiveXObject("Microsoft.XMLHTTP");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8448 } catch( e ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8449 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8450
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8451 // Create the request object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8452 // (This is still attached to ajaxSettings for backward compatibility)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8453 jQuery.ajaxSettings.xhr = window.ActiveXObject ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8454 /* Microsoft failed to properly
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8455 * implement the XMLHttpRequest in IE7 (can't request local files),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8456 * so we use the ActiveXObject when it is available
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8457 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8458 * we need a fallback.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8459 */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8460 function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8461 return !this.isLocal && createStandardXHR() || createActiveXHR();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8462 } :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8463 // For all other browsers, use the standard XMLHttpRequest object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8464 createStandardXHR;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8465
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8466 // Determine support properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8467 xhrSupported = jQuery.ajaxSettings.xhr();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8468 jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8469 xhrSupported = jQuery.support.ajax = !!xhrSupported;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8470
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8471 // Create transport if the browser can provide an xhr
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8472 if ( xhrSupported ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8473
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8474 jQuery.ajaxTransport(function( s ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8475 // Cross domain only allowed if supported through XMLHttpRequest
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8476 if ( !s.crossDomain || jQuery.support.cors ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8477
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8478 var callback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8479
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8480 return {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8481 send: function( headers, complete ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8482
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8483 // Get a new xhr
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8484 var handle, i,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8485 xhr = s.xhr();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8486
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8487 // Open the socket
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8488 // Passing null username, generates a login popup on Opera (#2865)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8489 if ( s.username ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8490 xhr.open( s.type, s.url, s.async, s.username, s.password );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8491 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8492 xhr.open( s.type, s.url, s.async );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8493 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8494
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8495 // Apply custom fields if provided
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8496 if ( s.xhrFields ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8497 for ( i in s.xhrFields ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8498 xhr[ i ] = s.xhrFields[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8499 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8500 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8501
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8502 // Override mime type if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8503 if ( s.mimeType && xhr.overrideMimeType ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8504 xhr.overrideMimeType( s.mimeType );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8505 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8506
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8507 // X-Requested-With header
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8508 // For cross-domain requests, seeing as conditions for a preflight are
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8509 // akin to a jigsaw puzzle, we simply never set it to be sure.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8510 // (it can always be set on a per-request basis or even using ajaxSetup)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8511 // For same-domain requests, won't change header if already provided.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8512 if ( !s.crossDomain && !headers["X-Requested-With"] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8513 headers["X-Requested-With"] = "XMLHttpRequest";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8514 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8515
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8516 // Need an extra try/catch for cross domain requests in Firefox 3
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8517 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8518 for ( i in headers ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8519 xhr.setRequestHeader( i, headers[ i ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8520 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8521 } catch( err ) {}
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8522
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8523 // Do send the request
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8524 // This may raise an exception which is actually
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8525 // handled in jQuery.ajax (so no try/catch here)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8526 xhr.send( ( s.hasContent && s.data ) || null );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8527
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8528 // Listener
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8529 callback = function( _, isAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8530 var status, responseHeaders, statusText, responses;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8531
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8532 // Firefox throws exceptions when accessing properties
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8533 // of an xhr when a network error occurred
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8534 // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8535 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8536
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8537 // Was never called and is aborted or complete
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8538 if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8539
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8540 // Only called once
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8541 callback = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8542
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8543 // Do not keep as active anymore
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8544 if ( handle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8545 xhr.onreadystatechange = jQuery.noop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8546 if ( xhrOnUnloadAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8547 delete xhrCallbacks[ handle ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8548 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8549 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8550
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8551 // If it's an abort
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8552 if ( isAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8553 // Abort it manually if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8554 if ( xhr.readyState !== 4 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8555 xhr.abort();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8556 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8557 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8558 responses = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8559 status = xhr.status;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8560 responseHeaders = xhr.getAllResponseHeaders();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8561
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8562 // When requesting binary data, IE6-9 will throw an exception
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8563 // on any attempt to access responseText (#11426)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8564 if ( typeof xhr.responseText === "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8565 responses.text = xhr.responseText;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8566 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8567
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8568 // Firefox throws an exception when accessing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8569 // statusText for faulty cross-domain requests
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8570 try {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8571 statusText = xhr.statusText;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8572 } catch( e ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8573 // We normalize with Webkit giving an empty statusText
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8574 statusText = "";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8575 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8576
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8577 // Filter status for non standard behaviors
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8578
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8579 // If the request is local and we have data: assume a success
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8580 // (success with no data won't get notified, that's the best we
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8581 // can do given current implementations)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8582 if ( !status && s.isLocal && !s.crossDomain ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8583 status = responses.text ? 200 : 404;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8584 // IE - #1450: sometimes returns 1223 when it should be 204
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8585 } else if ( status === 1223 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8586 status = 204;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8587 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8588 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8589 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8590 } catch( firefoxAccessException ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8591 if ( !isAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8592 complete( -1, firefoxAccessException );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8593 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8594 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8595
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8596 // Call complete if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8597 if ( responses ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8598 complete( status, statusText, responses, responseHeaders );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8599 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8600 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8601
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8602 if ( !s.async ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8603 // if we're in sync mode we fire the callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8604 callback();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8605 } else if ( xhr.readyState === 4 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8606 // (IE6 & IE7) if it's in cache and has been
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8607 // retrieved directly we need to fire the callback
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8608 setTimeout( callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8609 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8610 handle = ++xhrId;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8611 if ( xhrOnUnloadAbort ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8612 // Create the active xhrs callbacks list if needed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8613 // and attach the unload handler
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8614 if ( !xhrCallbacks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8615 xhrCallbacks = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8616 jQuery( window ).unload( xhrOnUnloadAbort );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8617 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8618 // Add to list of active xhrs callbacks
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8619 xhrCallbacks[ handle ] = callback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8620 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8621 xhr.onreadystatechange = callback;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8622 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8623 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8624
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8625 abort: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8626 if ( callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8627 callback( undefined, true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8628 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8629 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8630 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8631 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8632 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8633 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8634 var fxNow, timerId,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8635 rfxtypes = /^(?:toggle|show|hide)$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8636 rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8637 rrun = /queueHooks$/,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8638 animationPrefilters = [ defaultPrefilter ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8639 tweeners = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8640 "*": [function( prop, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8641 var end, unit,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8642 tween = this.createTween( prop, value ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8643 parts = rfxnum.exec( value ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8644 target = tween.cur(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8645 start = +target || 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8646 scale = 1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8647 maxIterations = 20;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8648
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8649 if ( parts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8650 end = +parts[2];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8651 unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8652
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8653 // We need to compute starting value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8654 if ( unit !== "px" && start ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8655 // Iteratively approximate from a nonzero starting point
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8656 // Prefer the current property, because this process will be trivial if it uses the same units
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8657 // Fallback to end or a simple constant
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8658 start = jQuery.css( tween.elem, prop, true ) || end || 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8659
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8660 do {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8661 // If previous iteration zeroed out, double until we get *something*
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8662 // Use a string for doubling factor so we don't accidentally see scale as unchanged below
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8663 scale = scale || ".5";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8664
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8665 // Adjust and apply
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8666 start = start / scale;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8667 jQuery.style( tween.elem, prop, start + unit );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8668
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8669 // Update scale, tolerating zero or NaN from tween.cur()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8670 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8671 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8672 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8673
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8674 tween.unit = unit;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8675 tween.start = start;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8676 // If a +=/-= token was provided, we're doing a relative animation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8677 tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8678 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8679 return tween;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8680 }]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8681 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8682
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8683 // Animations created synchronously will run synchronously
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8684 function createFxNow() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8685 setTimeout(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8686 fxNow = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8687 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8688 return ( fxNow = jQuery.now() );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8689 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8690
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8691 function createTweens( animation, props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8692 jQuery.each( props, function( prop, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8693 var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8694 index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8695 length = collection.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8696 for ( ; index < length; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8697 if ( collection[ index ].call( animation, prop, value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8698
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8699 // we're done with this property
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8700 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8701 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8702 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8703 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8704 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8705
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8706 function Animation( elem, properties, options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8707 var result,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8708 stopped,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8709 index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8710 length = animationPrefilters.length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8711 deferred = jQuery.Deferred().always( function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8712 // don't match elem in the :animated selector
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8713 delete tick.elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8714 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8715 tick = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8716 if ( stopped ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8717 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8718 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8719 var currentTime = fxNow || createFxNow(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8720 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8721 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8722 temp = remaining / animation.duration || 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8723 percent = 1 - temp,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8724 index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8725 length = animation.tweens.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8726
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8727 for ( ; index < length ; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8728 animation.tweens[ index ].run( percent );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8729 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8730
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8731 deferred.notifyWith( elem, [ animation, percent, remaining ]);
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8732
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8733 if ( percent < 1 && length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8734 return remaining;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8735 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8736 deferred.resolveWith( elem, [ animation ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8737 return false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8738 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8739 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8740 animation = deferred.promise({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8741 elem: elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8742 props: jQuery.extend( {}, properties ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8743 opts: jQuery.extend( true, { specialEasing: {} }, options ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8744 originalProperties: properties,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8745 originalOptions: options,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8746 startTime: fxNow || createFxNow(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8747 duration: options.duration,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8748 tweens: [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8749 createTween: function( prop, end ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8750 var tween = jQuery.Tween( elem, animation.opts, prop, end,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8751 animation.opts.specialEasing[ prop ] || animation.opts.easing );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8752 animation.tweens.push( tween );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8753 return tween;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8754 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8755 stop: function( gotoEnd ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8756 var index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8757 // if we are going to the end, we want to run all the tweens
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8758 // otherwise we skip this part
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8759 length = gotoEnd ? animation.tweens.length : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8760 if ( stopped ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8761 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8762 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8763 stopped = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8764 for ( ; index < length ; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8765 animation.tweens[ index ].run( 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8766 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8767
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8768 // resolve when we played the last frame
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8769 // otherwise, reject
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8770 if ( gotoEnd ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8771 deferred.resolveWith( elem, [ animation, gotoEnd ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8772 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8773 deferred.rejectWith( elem, [ animation, gotoEnd ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8774 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8775 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8776 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8777 }),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8778 props = animation.props;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8779
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8780 propFilter( props, animation.opts.specialEasing );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8781
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8782 for ( ; index < length ; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8783 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8784 if ( result ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8785 return result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8786 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8787 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8788
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8789 createTweens( animation, props );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8790
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8791 if ( jQuery.isFunction( animation.opts.start ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8792 animation.opts.start.call( elem, animation );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8793 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8794
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8795 jQuery.fx.timer(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8796 jQuery.extend( tick, {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8797 elem: elem,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8798 anim: animation,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8799 queue: animation.opts.queue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8800 })
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8801 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8802
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8803 // attach callbacks from options
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8804 return animation.progress( animation.opts.progress )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8805 .done( animation.opts.done, animation.opts.complete )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8806 .fail( animation.opts.fail )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8807 .always( animation.opts.always );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8808 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8809
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8810 function propFilter( props, specialEasing ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8811 var value, name, index, easing, hooks;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8812
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8813 // camelCase, specialEasing and expand cssHook pass
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8814 for ( index in props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8815 name = jQuery.camelCase( index );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8816 easing = specialEasing[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8817 value = props[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8818 if ( jQuery.isArray( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8819 easing = value[ 1 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8820 value = props[ index ] = value[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8821 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8822
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8823 if ( index !== name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8824 props[ name ] = value;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8825 delete props[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8826 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8827
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8828 hooks = jQuery.cssHooks[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8829 if ( hooks && "expand" in hooks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8830 value = hooks.expand( value );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8831 delete props[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8832
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8833 // not quite $.extend, this wont overwrite keys already present.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8834 // also - reusing 'index' from above because we have the correct "name"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8835 for ( index in value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8836 if ( !( index in props ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8837 props[ index ] = value[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8838 specialEasing[ index ] = easing;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8839 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8840 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8841 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8842 specialEasing[ name ] = easing;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8843 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8844 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8845 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8846
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8847 jQuery.Animation = jQuery.extend( Animation, {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8848
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8849 tweener: function( props, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8850 if ( jQuery.isFunction( props ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8851 callback = props;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8852 props = [ "*" ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8853 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8854 props = props.split(" ");
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8855 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8856
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8857 var prop,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8858 index = 0,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8859 length = props.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8860
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8861 for ( ; index < length ; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8862 prop = props[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8863 tweeners[ prop ] = tweeners[ prop ] || [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8864 tweeners[ prop ].unshift( callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8865 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8866 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8867
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8868 prefilter: function( callback, prepend ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8869 if ( prepend ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8870 animationPrefilters.unshift( callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8871 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8872 animationPrefilters.push( callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8873 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8874 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8875 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8876
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8877 function defaultPrefilter( elem, props, opts ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8878 /*jshint validthis:true */
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8879 var prop, index, length,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8880 value, dataShow, toggle,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8881 tween, hooks, oldfire,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8882 anim = this,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8883 style = elem.style,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8884 orig = {},
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8885 handled = [],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8886 hidden = elem.nodeType && isHidden( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8887
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8888 // handle queue: false promises
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8889 if ( !opts.queue ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8890 hooks = jQuery._queueHooks( elem, "fx" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8891 if ( hooks.unqueued == null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8892 hooks.unqueued = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8893 oldfire = hooks.empty.fire;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8894 hooks.empty.fire = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8895 if ( !hooks.unqueued ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8896 oldfire();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8897 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8898 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8899 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8900 hooks.unqueued++;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8901
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8902 anim.always(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8903 // doing this makes sure that the complete handler will be called
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8904 // before this completes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8905 anim.always(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8906 hooks.unqueued--;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8907 if ( !jQuery.queue( elem, "fx" ).length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8908 hooks.empty.fire();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8909 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8910 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8911 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8912 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8913
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8914 // height/width overflow pass
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8915 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8916 // Make sure that nothing sneaks out
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8917 // Record all 3 overflow attributes because IE does not
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8918 // change the overflow attribute when overflowX and
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8919 // overflowY are set to the same value
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8920 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8921
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8922 // Set display property to inline-block for height/width
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8923 // animations on inline elements that are having width/height animated
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8924 if ( jQuery.css( elem, "display" ) === "inline" &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8925 jQuery.css( elem, "float" ) === "none" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8926
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8927 // inline-level elements accept inline-block;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8928 // block-level elements need to be inline with layout
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8929 if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8930 style.display = "inline-block";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8931
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8932 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8933 style.zoom = 1;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8934 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8935 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8936 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8937
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8938 if ( opts.overflow ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8939 style.overflow = "hidden";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8940 if ( !jQuery.support.shrinkWrapBlocks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8941 anim.always(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8942 style.overflow = opts.overflow[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8943 style.overflowX = opts.overflow[ 1 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8944 style.overflowY = opts.overflow[ 2 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8945 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8946 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8947 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8948
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8949
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8950 // show/hide pass
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8951 for ( index in props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8952 value = props[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8953 if ( rfxtypes.exec( value ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8954 delete props[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8955 toggle = toggle || value === "toggle";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8956 if ( value === ( hidden ? "hide" : "show" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8957 continue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8958 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8959 handled.push( index );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8960 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8961 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8962
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8963 length = handled.length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8964 if ( length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8965 dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8966 if ( "hidden" in dataShow ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8967 hidden = dataShow.hidden;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8968 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8969
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8970 // store state if its toggle - enables .stop().toggle() to "reverse"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8971 if ( toggle ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8972 dataShow.hidden = !hidden;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8973 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8974 if ( hidden ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8975 jQuery( elem ).show();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8976 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8977 anim.done(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8978 jQuery( elem ).hide();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8979 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8980 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8981 anim.done(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8982 var prop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8983 jQuery._removeData( elem, "fxshow" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8984 for ( prop in orig ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8985 jQuery.style( elem, prop, orig[ prop ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8986 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8987 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8988 for ( index = 0 ; index < length ; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8989 prop = handled[ index ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8990 tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8991 orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8992
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8993 if ( !( prop in dataShow ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8994 dataShow[ prop ] = tween.start;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8995 if ( hidden ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8996 tween.end = tween.start;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8997 tween.start = prop === "width" || prop === "height" ? 1 : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8998 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8999 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9000 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9001 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9002 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9003
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9004 function Tween( elem, options, prop, end, easing ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9005 return new Tween.prototype.init( elem, options, prop, end, easing );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9006 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9007 jQuery.Tween = Tween;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9008
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9009 Tween.prototype = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9010 constructor: Tween,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9011 init: function( elem, options, prop, end, easing, unit ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9012 this.elem = elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9013 this.prop = prop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9014 this.easing = easing || "swing";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9015 this.options = options;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9016 this.start = this.now = this.cur();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9017 this.end = end;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9018 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9019 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9020 cur: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9021 var hooks = Tween.propHooks[ this.prop ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9022
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9023 return hooks && hooks.get ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9024 hooks.get( this ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9025 Tween.propHooks._default.get( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9026 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9027 run: function( percent ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9028 var eased,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9029 hooks = Tween.propHooks[ this.prop ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9030
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9031 if ( this.options.duration ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9032 this.pos = eased = jQuery.easing[ this.easing ](
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9033 percent, this.options.duration * percent, 0, 1, this.options.duration
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9034 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9035 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9036 this.pos = eased = percent;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9037 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9038 this.now = ( this.end - this.start ) * eased + this.start;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9039
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9040 if ( this.options.step ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9041 this.options.step.call( this.elem, this.now, this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9042 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9043
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9044 if ( hooks && hooks.set ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9045 hooks.set( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9046 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9047 Tween.propHooks._default.set( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9048 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9049 return this;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9050 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9051 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9052
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9053 Tween.prototype.init.prototype = Tween.prototype;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9054
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9055 Tween.propHooks = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9056 _default: {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9057 get: function( tween ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9058 var result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9059
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9060 if ( tween.elem[ tween.prop ] != null &&
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9061 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9062 return tween.elem[ tween.prop ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9063 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9064
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9065 // passing an empty string as a 3rd parameter to .css will automatically
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9066 // attempt a parseFloat and fallback to a string if the parse fails
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9067 // so, simple values such as "10px" are parsed to Float.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9068 // complex values such as "rotate(1rad)" are returned as is.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9069 result = jQuery.css( tween.elem, tween.prop, "" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9070 // Empty strings, null, undefined and "auto" are converted to 0.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9071 return !result || result === "auto" ? 0 : result;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9072 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9073 set: function( tween ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9074 // use step hook for back compat - use cssHook if its there - use .style if its
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9075 // available and use plain properties where available
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9076 if ( jQuery.fx.step[ tween.prop ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9077 jQuery.fx.step[ tween.prop ]( tween );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9078 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9079 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9080 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9081 tween.elem[ tween.prop ] = tween.now;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9082 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9083 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9084 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9085 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9086
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9087 // Remove in 2.0 - this supports IE8's panic based approach
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9088 // to setting things on disconnected nodes
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9089
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9090 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9091 set: function( tween ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9092 if ( tween.elem.nodeType && tween.elem.parentNode ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9093 tween.elem[ tween.prop ] = tween.now;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9094 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9095 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9096 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9097
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9098 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9099 var cssFn = jQuery.fn[ name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9100 jQuery.fn[ name ] = function( speed, easing, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9101 return speed == null || typeof speed === "boolean" ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9102 cssFn.apply( this, arguments ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9103 this.animate( genFx( name, true ), speed, easing, callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9104 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9105 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9106
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9107 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9108 fadeTo: function( speed, to, easing, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9109
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9110 // show any hidden elements after setting opacity to 0
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9111 return this.filter( isHidden ).css( "opacity", 0 ).show()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9112
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9113 // animate to the value specified
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9114 .end().animate({ opacity: to }, speed, easing, callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9115 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9116 animate: function( prop, speed, easing, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9117 var empty = jQuery.isEmptyObject( prop ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9118 optall = jQuery.speed( speed, easing, callback ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9119 doAnimation = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9120 // Operate on a copy of prop so per-property easing won't be lost
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9121 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9122 doAnimation.finish = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9123 anim.stop( true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9124 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9125 // Empty animations, or finishing resolves immediately
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9126 if ( empty || jQuery._data( this, "finish" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9127 anim.stop( true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9128 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9129 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9130 doAnimation.finish = doAnimation;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9131
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9132 return empty || optall.queue === false ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9133 this.each( doAnimation ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9134 this.queue( optall.queue, doAnimation );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9135 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9136 stop: function( type, clearQueue, gotoEnd ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9137 var stopQueue = function( hooks ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9138 var stop = hooks.stop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9139 delete hooks.stop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9140 stop( gotoEnd );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9141 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9142
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9143 if ( typeof type !== "string" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9144 gotoEnd = clearQueue;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9145 clearQueue = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9146 type = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9147 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9148 if ( clearQueue && type !== false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9149 this.queue( type || "fx", [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9150 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9151
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9152 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9153 var dequeue = true,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9154 index = type != null && type + "queueHooks",
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9155 timers = jQuery.timers,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9156 data = jQuery._data( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9157
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9158 if ( index ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9159 if ( data[ index ] && data[ index ].stop ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9160 stopQueue( data[ index ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9161 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9162 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9163 for ( index in data ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9164 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9165 stopQueue( data[ index ] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9166 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9167 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9168 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9169
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9170 for ( index = timers.length; index--; ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9171 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9172 timers[ index ].anim.stop( gotoEnd );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9173 dequeue = false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9174 timers.splice( index, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9175 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9176 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9177
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9178 // start the next in the queue if the last step wasn't forced
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9179 // timers currently will call their complete callbacks, which will dequeue
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9180 // but only if they were gotoEnd
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9181 if ( dequeue || !gotoEnd ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9182 jQuery.dequeue( this, type );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9183 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9184 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9185 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9186 finish: function( type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9187 if ( type !== false ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9188 type = type || "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9189 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9190 return this.each(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9191 var index,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9192 data = jQuery._data( this ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9193 queue = data[ type + "queue" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9194 hooks = data[ type + "queueHooks" ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9195 timers = jQuery.timers,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9196 length = queue ? queue.length : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9197
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9198 // enable finishing flag on private data
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9199 data.finish = true;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9200
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9201 // empty the queue first
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9202 jQuery.queue( this, type, [] );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9203
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9204 if ( hooks && hooks.cur && hooks.cur.finish ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9205 hooks.cur.finish.call( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9206 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9207
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9208 // look for any active animations, and finish them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9209 for ( index = timers.length; index--; ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9210 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9211 timers[ index ].anim.stop( true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9212 timers.splice( index, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9213 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9214 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9215
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9216 // look for any animations in the old queue and finish them
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9217 for ( index = 0; index < length; index++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9218 if ( queue[ index ] && queue[ index ].finish ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9219 queue[ index ].finish.call( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9220 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9221 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9222
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9223 // turn off finishing flag
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9224 delete data.finish;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9225 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9226 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9227 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9228
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9229 // Generate parameters to create a standard animation
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9230 function genFx( type, includeWidth ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9231 var which,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9232 attrs = { height: type },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9233 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9234
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9235 // if we include width, step value is 1 to do all cssExpand values,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9236 // if we don't include width, step value is 2 to skip over Left and Right
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9237 includeWidth = includeWidth? 1 : 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9238 for( ; i < 4 ; i += 2 - includeWidth ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9239 which = cssExpand[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9240 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9241 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9242
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9243 if ( includeWidth ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9244 attrs.opacity = attrs.width = type;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9245 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9246
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9247 return attrs;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9248 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9249
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9250 // Generate shortcuts for custom animations
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9251 jQuery.each({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9252 slideDown: genFx("show"),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9253 slideUp: genFx("hide"),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9254 slideToggle: genFx("toggle"),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9255 fadeIn: { opacity: "show" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9256 fadeOut: { opacity: "hide" },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9257 fadeToggle: { opacity: "toggle" }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9258 }, function( name, props ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9259 jQuery.fn[ name ] = function( speed, easing, callback ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9260 return this.animate( props, speed, easing, callback );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9261 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9262 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9263
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9264 jQuery.speed = function( speed, easing, fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9265 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9266 complete: fn || !fn && easing ||
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9267 jQuery.isFunction( speed ) && speed,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9268 duration: speed,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9269 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9270 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9271
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9272 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9273 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9274
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9275 // normalize opt.queue - true/undefined/null -> "fx"
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9276 if ( opt.queue == null || opt.queue === true ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9277 opt.queue = "fx";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9278 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9279
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9280 // Queueing
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9281 opt.old = opt.complete;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9282
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9283 opt.complete = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9284 if ( jQuery.isFunction( opt.old ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9285 opt.old.call( this );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9286 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9287
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9288 if ( opt.queue ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9289 jQuery.dequeue( this, opt.queue );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9290 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9291 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9292
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9293 return opt;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9294 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9295
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9296 jQuery.easing = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9297 linear: function( p ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9298 return p;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9299 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9300 swing: function( p ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9301 return 0.5 - Math.cos( p*Math.PI ) / 2;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9302 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9303 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9304
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9305 jQuery.timers = [];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9306 jQuery.fx = Tween.prototype.init;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9307 jQuery.fx.tick = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9308 var timer,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9309 timers = jQuery.timers,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9310 i = 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9311
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9312 fxNow = jQuery.now();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9313
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9314 for ( ; i < timers.length; i++ ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9315 timer = timers[ i ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9316 // Checks the timer has not already been removed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9317 if ( !timer() && timers[ i ] === timer ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9318 timers.splice( i--, 1 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9319 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9320 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9321
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9322 if ( !timers.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9323 jQuery.fx.stop();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9324 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9325 fxNow = undefined;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9326 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9327
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9328 jQuery.fx.timer = function( timer ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9329 if ( timer() && jQuery.timers.push( timer ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9330 jQuery.fx.start();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9331 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9332 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9333
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9334 jQuery.fx.interval = 13;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9335
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9336 jQuery.fx.start = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9337 if ( !timerId ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9338 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9339 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9340 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9341
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9342 jQuery.fx.stop = function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9343 clearInterval( timerId );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9344 timerId = null;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9345 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9346
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9347 jQuery.fx.speeds = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9348 slow: 600,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9349 fast: 200,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9350 // Default speed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9351 _default: 400
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9352 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9353
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9354 // Back Compat <1.8 extension point
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9355 jQuery.fx.step = {};
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9356
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9357 if ( jQuery.expr && jQuery.expr.filters ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9358 jQuery.expr.filters.animated = function( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9359 return jQuery.grep(jQuery.timers, function( fn ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9360 return elem === fn.elem;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9361 }).length;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9362 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9363 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9364 jQuery.fn.offset = function( options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9365 if ( arguments.length ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9366 return options === undefined ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9367 this :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9368 this.each(function( i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9369 jQuery.offset.setOffset( this, options, i );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9370 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9371 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9372
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9373 var docElem, win,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9374 box = { top: 0, left: 0 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9375 elem = this[ 0 ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9376 doc = elem && elem.ownerDocument;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9377
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9378 if ( !doc ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9379 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9380 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9381
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9382 docElem = doc.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9383
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9384 // Make sure it's not a disconnected DOM node
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9385 if ( !jQuery.contains( docElem, elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9386 return box;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9387 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9388
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9389 // If we don't have gBCR, just use 0,0 rather than error
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9390 // BlackBerry 5, iOS 3 (original iPhone)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9391 if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9392 box = elem.getBoundingClientRect();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9393 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9394 win = getWindow( doc );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9395 return {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9396 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9397 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9398 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9399 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9400
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9401 jQuery.offset = {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9402
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9403 setOffset: function( elem, options, i ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9404 var position = jQuery.css( elem, "position" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9405
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9406 // set position first, in-case top/left are set even on static elem
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9407 if ( position === "static" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9408 elem.style.position = "relative";
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9409 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9410
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9411 var curElem = jQuery( elem ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9412 curOffset = curElem.offset(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9413 curCSSTop = jQuery.css( elem, "top" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9414 curCSSLeft = jQuery.css( elem, "left" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9415 calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9416 props = {}, curPosition = {}, curTop, curLeft;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9417
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9418 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9419 if ( calculatePosition ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9420 curPosition = curElem.position();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9421 curTop = curPosition.top;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9422 curLeft = curPosition.left;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9423 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9424 curTop = parseFloat( curCSSTop ) || 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9425 curLeft = parseFloat( curCSSLeft ) || 0;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9426 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9427
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9428 if ( jQuery.isFunction( options ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9429 options = options.call( elem, i, curOffset );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9430 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9431
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9432 if ( options.top != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9433 props.top = ( options.top - curOffset.top ) + curTop;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9434 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9435 if ( options.left != null ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9436 props.left = ( options.left - curOffset.left ) + curLeft;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9437 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9438
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9439 if ( "using" in options ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9440 options.using.call( elem, props );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9441 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9442 curElem.css( props );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9443 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9444 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9445 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9446
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9447
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9448 jQuery.fn.extend({
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9449
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9450 position: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9451 if ( !this[ 0 ] ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9452 return;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9453 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9454
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9455 var offsetParent, offset,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9456 parentOffset = { top: 0, left: 0 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9457 elem = this[ 0 ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9458
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9459 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9460 if ( jQuery.css( elem, "position" ) === "fixed" ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9461 // we assume that getBoundingClientRect is available when computed position is fixed
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9462 offset = elem.getBoundingClientRect();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9463 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9464 // Get *real* offsetParent
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9465 offsetParent = this.offsetParent();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9466
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9467 // Get correct offsets
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9468 offset = this.offset();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9469 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9470 parentOffset = offsetParent.offset();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9471 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9472
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9473 // Add offsetParent borders
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9474 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9475 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9476 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9477
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9478 // Subtract parent offsets and element margins
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9479 // note: when an element has margin: auto the offsetLeft and marginLeft
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9480 // are the same in Safari causing offset.left to incorrectly be 0
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9481 return {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9482 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9483 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9484 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9485 },
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9486
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9487 offsetParent: function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9488 return this.map(function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9489 var offsetParent = this.offsetParent || document.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9490 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9491 offsetParent = offsetParent.offsetParent;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9492 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9493 return offsetParent || document.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9494 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9495 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9496 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9497
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9498
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9499 // Create scrollLeft and scrollTop methods
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9500 jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9501 var top = /Y/.test( prop );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9502
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9503 jQuery.fn[ method ] = function( val ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9504 return jQuery.access( this, function( elem, method, val ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9505 var win = getWindow( elem );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9506
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9507 if ( val === undefined ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9508 return win ? (prop in win) ? win[ prop ] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9509 win.document.documentElement[ method ] :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9510 elem[ method ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9511 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9512
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9513 if ( win ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9514 win.scrollTo(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9515 !top ? val : jQuery( win ).scrollLeft(),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9516 top ? val : jQuery( win ).scrollTop()
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9517 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9518
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9519 } else {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9520 elem[ method ] = val;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9521 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9522 }, method, val, arguments.length, null );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9523 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9524 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9525
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9526 function getWindow( elem ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9527 return jQuery.isWindow( elem ) ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9528 elem :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9529 elem.nodeType === 9 ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9530 elem.defaultView || elem.parentWindow :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9531 false;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9532 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9533 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9534 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9535 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9536 // margin is only for outerHeight, outerWidth
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9537 jQuery.fn[ funcName ] = function( margin, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9538 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9539 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9540
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9541 return jQuery.access( this, function( elem, type, value ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9542 var doc;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9543
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9544 if ( jQuery.isWindow( elem ) ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9545 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9546 // isn't a whole lot we can do. See pull request at this URL for discussion:
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9547 // https://github.com/jquery/jquery/pull/764
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9548 return elem.document.documentElement[ "client" + name ];
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9549 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9550
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9551 // Get document width or height
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9552 if ( elem.nodeType === 9 ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9553 doc = elem.documentElement;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9554
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9555 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9556 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9557 return Math.max(
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9558 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9559 elem.body[ "offset" + name ], doc[ "offset" + name ],
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9560 doc[ "client" + name ]
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9561 );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9562 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9563
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9564 return value === undefined ?
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9565 // Get width or height on the element, requesting but not forcing parseFloat
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9566 jQuery.css( elem, type, extra ) :
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9567
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9568 // Set width or height on the element
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9569 jQuery.style( elem, type, value, extra );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9570 }, type, chainable ? margin : undefined, chainable, null );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9571 };
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9572 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9573 });
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9574 // Limit scope pollution from any deprecated API
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9575 // (function() {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9576
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9577 // })();
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9578 // Expose jQuery to the global object
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9579 window.jQuery = window.$ = jQuery;
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9580
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9581 // Expose jQuery as an AMD module, but only for AMD loaders that
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9582 // understand the issues with loading multiple versions of jQuery
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9583 // in a page that all might call define(). The loader will indicate
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9584 // they have special allowances for multiple jQuery versions by
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9585 // specifying define.amd.jQuery = true. Register as a named module,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9586 // since jQuery can be concatenated with other files that may use define,
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9587 // but not use a proper concatenation script that understands anonymous
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9588 // AMD modules. A named AMD is safest and most robust way to register.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9589 // Lowercase jquery is used because AMD module names are derived from
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9590 // file names, and jQuery is normally delivered in a lowercase file name.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9591 // Do this after creating the global so that if an AMD module wants to call
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9592 // noConflict to hide this version of jQuery, it will work.
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9593 if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9594 define( "jquery", [], function () { return jQuery; } );
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9595 }
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9596
4a9dbee41a6c Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9597 })( window );

mercurial