WALA/com.ibm.wala.cast.js.test.data/examples-src/pages/jquery.html

264 lines
12 KiB
HTML
Executable File

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script>
(function top () {
var c = n.jQuery = n.$ = function dollar (a, d) {
return new c.fn.init(a, d)
}
c.fn = c.prototype = {
init: function init (a, d) {
a = a || document;
if (a.nodeType) {
this[0] = a;
this.length = 1;
this.context = a;
return this
}
if (typeof a === "string") {
var f = r.exec(a);
if (f && (f[1] || !d)) if (f[1]) a = c.clean([f[1]], d);
else {
if ((d = document.getElementById(f[3])) && d.id != f[3]) return c().find(a);
f = c(d || []);
f.context = document;
f.selector = a;
return f
} else return c(d).find(a)
} else if (c.isFunction(a)) return c(document).ready(a);
if (a.selector && a.context) {
this.selector =
a.selector;
this.context = a.context
}
return this.setArray(c.isArray(a) ? a : c.makeArray(a))
}
};
c.extend = c.fn.extend = function extend () {
var a =
arguments[0] || {},
d = 1,
f = arguments.length,
j = false,
q;
if (typeof a === "boolean") {
j = a;
a = arguments[1] || {};
d = 2
}
if (typeof a !== "object" && !c.isFunction(a)) a = {};
if (f == d) {
a = this;
--d
}
for (; d < f; d++) if ((q = arguments[d]) != null) for (var t in q) {
var y = a[t],
A = q[t];
if (a !== A) if (j && A && typeof A === "object" && !A.nodeType) a[t] = c.extend(j, y || (A.length != null ? [] : {}), A);
else if (A !== void 0) a[t] = A
}
return a
};
c.extend({
noConflict: function noConflict (a) {
n.$ =
B;
if (a) n.jQuery = w;
return c
},
isFunction: 2,
each: function each (a, d, f) {
var j, q = 0,
t = a.length;
if (f) if (t === void 0) for (j in a) {
if (d.apply(a[j], f) === false) break
} else for (; q < t;) {
if (d.apply(a[q++], f) === false) break
} else if (t === void 0) for (j in a) {
if (d.call(a[j], j, a[j]) === false) break
} else for (f = a[0]; q < t && d.call(f, q, f) !== false; f = a[++q]);
return a
},
className: {
add: function add (a, d) {
c.each((d || "").split(/\s+/), function (f, j) {
if (a.nodeType == 1 && !c.className.has(a.className, j)) a.className += (a.className ? " " : "") + j
})
},
remove: function remove (a, d) {
if (a.nodeType == 1) a.className = d !== void 0 ? c.grep(a.className.split(/\s+/), function (f) {
return !c.className.has(d, f)
}).join(" ") : ""
},
has: function has (a, d) {
return a && c.inArray(d, (a.className || a).toString().split(/\s+/)) > -1
}
},
swap: function swap (a, d, f) {
var j = {};
for (var q in d) {
j[q] = a.style[q];
a.style[q] = d[q]
}
f.call(a);
for (q in d) a.style[q] = j[q]
},
css: function css (a, d, f, j) {
if (d == "width" || d == "height") {
var q;
f = {
position: "absolute",
visibility: "hidden",
display: "block"
};
var t = d == "width" ? ["Left", "Right"] : ["Top", "Bottom"],
y = function () {
q = d == "width" ? a.offsetWidth : a.offsetHeight;
j !== "border" && c.each(t, function () {
j || (q -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0);
if (j === "margin") q += parseFloat(c.curCSS(a, "margin" + this, true)) || 0;
else q -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0
})
};
a.offsetWidth !== 0 ? y() : c.swap(a, f, y);
return Math.max(0, Math.round(q))
}
return c.curCSS(a, d, f)
},
curCSS: function curCSS (a, d, f) {
var j, q = a.style;
if (d == "opacity" && !c.support.opacity) {
j = c.attr(q, "opacity");
return j == "" ? "1" : j
}
if (d.match(/float/i)) d = W;
if (!f && q && q[d]) j = q[d];
else if (F.getComputedStyle) {
if (d.match(/float/i)) d = "float";
d = d.replace(/([A-Z])/g, "-$1").toLowerCase();
if (a = F.getComputedStyle(a, null)) j = a.getPropertyValue(d);
if (d == "opacity" && j == "") j = "1"
} else if (a.currentStyle) {
j = d.replace(/\-(\w)/g, function (t, y) {
return y.toUpperCase()
});
j = a.currentStyle[d] || a.currentStyle[j];
if (!/^\d+(px)?$/i.test(j) && /^\d/.test(j)) {
d = q.left;
f = a.runtimeStyle.left;
a.runtimeStyle.left = a.currentStyle.left;
q.left = j || 0;
j = q.pixelLeft + "px";
q.left = d;
a.runtimeStyle.left = f
}
}
return j
},
clean: function clean (a, d, f) {
d = d || document;
if (typeof d.createElement === "undefined") d = d.ownerDocument || d[0] && d[0].ownerDocument || document;
if (!f && a.length === 1 && typeof a[0] === "string") {
var j = /^<(\w+)\s*\/?>$/.exec(a[0]);
if (j) return [d.createElement(j[1])]
}
c.each(a, function (y, A) {
if (typeof A === "number") A += "";
if (A) {
if (typeof A === "string") {
A = A.replace(/(<(\w+)[^>]*?)\/>/g, function (M, Q, S) {
return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? M : Q + "></" + S + ">"
});
y = A.replace(/^\s+/, "").substring(0, 10).toLowerCase();
var L = !y.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !y.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || y.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !y.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!y.indexOf("<td") || !y.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !y.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !c.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""];
for (t.innerHTML = L[1] + A + L[2]; L[0]--;) t = t.lastChild;
if (!c.support.tbody) {
var N = /<tbody/i.test(A);
y = !y.indexOf("<table") && !N ? t.firstChild && t.firstChild.childNodes : L[1] == "<table>" && !N ? t.childNodes : [];
for (L = y.length - 1; L >= 0; --L) c.nodeName(y[L], "tbody") && !y[L].childNodes.length && y[L].parentNode.removeChild(y[L])
}!c.support.leadingWhitespace && /^\s/.test(A) && t.insertBefore(d.createTextNode(A.match(/^\s*/)[0]), t.firstChild);
A = c.makeArray(t.childNodes)
}
if (A.nodeType) q.push(A);
else q = c.merge(q, A)
}
});
if (f) {
for (a = 0; q[a]; a++) if (c.nodeName(q[a], "script") && (!q[a].type || q[a].type.toLowerCase() === "text/javascript")) j.push(q[a].parentNode ? q[a].parentNode.removeChild(q[a]) : q[a]);
else {
q[a].nodeType === 1 && q.splice.apply(q, [a + 1, 0].concat(c.makeArray(q[a].getElementsByTagName("script"))));
f.appendChild(q[a])
}
return j
}
return q
},
attr: function attr (a, d, f) {
if (!(!a || a.nodeType == 3 || a.nodeType == 8)) {
var j = !c.isXMLDoc(a),
q = f !== void 0;
d = j && c.props[d] || d;
if (a.tagName) {
var t = /href|src|style/.test(d);
if (d in a && j && !t) {
if (q) {
if (d == "type" && c.nodeName(a, "input") && a.parentNode) throw "type property can't be changed";
a[d] = f
}
if (c.nodeName(a, "form") && a.getAttributeNode(d)) return a.getAttributeNode(d).nodeValue;
if (d == "tabIndex") return (d = a.getAttributeNode("tabIndex")) && d.specified ? d.value : a.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : a.nodeName.match(/^(a|area)$/i) && a.href ? 0 : void 0;
return a[d]
}
if (!c.support.style && j && d == "style") return c.attr(a.style, "cssText", f);
q && a.setAttribute(d, "" + f);
a = !c.support.hrefNormalized && j && t ? a.getAttribute(d, 2) : a.getAttribute(d);
return a === null ? void 0 : a
}
if (!c.support.opacity && d == "opacity") {
if (q) {
a.zoom = 1;
a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(f) + "" == "NaN" ? "" : "alpha(opacity=" + f * 100 + ")")
}
return a.filter && a.filter.indexOf("opacity=") >= 0 ? parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100 + "" : ""
}
d = d.replace(/-([a-z])/ig, function (y, A) {
return A.toUpperCase()
});
if (q) a[d] = f;
return a[d]
}
},
makeArray: function makeArray (a) {
var d = [];
if (a != null) {
var f = a.length;
if (f == null || typeof a === "string" || c.isFunction(a) || a.setInterval) d[0] = a;
else for (; f;) d[--f] = a[f]
}
return d
},
inArray: function inArray (a, d) {
for (var f = 0, j = d.length; f < j; f++) if (d[f] === a) return f;
return -1
},
merge: function merge (a, d) {
var f = 0,
j, q = a.length;
if (c.support.getAll) for (;
(j = d[f++]) != null;) a[q++] = j;
else for (;
(j =
d[f++]) != null;) if (j.nodeType != 8) a[q++] = j;
return a
},
});
})();
</script>