liberty-prettydiff
Version:
Language aware code comparison tool for several web based languages. It also beautifies, minifies, and a few other things.
1,166 lines • 1.79 MB
Plain Text
if (typeof jQuery == "undefined") {
(function (window, undefined) {
var rootjQuery,
readyList,
document = window.document,
location = window.location,
navigator = window.navigator,
_jQuery = window.jQuery,
_$ = window.$,
core_push = Array.prototype.push,
core_slice = Array.prototype.slice,
core_indexOf = Array.prototype.indexOf,
core_toString = Object.prototype.toString,
core_hasOwn = Object.prototype.hasOwnProperty,
core_trim = String.prototype.trim,
jQuery = function (selector, context) {
return new jQuery
.fn
.init(selector, context, rootjQuery);
},
core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
core_rnotwhite = /\S/,
core_rspace = /\s+/,
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
fcamelCase = function (all, letter) {
return (letter + "").toUpperCase();
},
DOMContentLoaded = function () {
if (document.addEventListener) {
document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false);
jQuery.ready();
} else if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", DOMContentLoaded);
jQuery.ready();
}
},
class2type = {};
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
each : function (callback, args) {
return jQuery.each(this, callback, args);
},
end : function () {
return this.prevObject || this.constructor(null);
},
eq : function (i) {
i = +i;
return i === -1
? this.slice(i)
: this.slice(i, i + 1);
},
first : function () {
return this.eq(0);
},
get : function (num) {
return num == null
? this.toArray()
: (num < 0
? this[this.length + num]
: this[num]);
},
init : function (selector, context, rootjQuery) {
var match,
elem,
ret,
doc;
if (!selector) {
return this;
}
if (selector.nodeType) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
if (typeof selector === "string") {
if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
match = [null, selector, null];
} else {
match = rquickExpr.exec(selector);
}
if (match && (match[1] || !context)) {
if (match[1]) {
context = context instanceof jQuery
? context[0]
: context;
doc = (context && context.nodeType
? context.ownerDocument || context
: document);
selector = jQuery.parseHTML(match[1], doc, true);
if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
this
.attr
.call(selector, context, true);
}
return jQuery.merge(this, selector);
} else {
elem = document.getElementById(match[2]);
if (elem && elem.parentNode) {
if (elem.id !== match[2]) {
return rootjQuery.find(selector);
}
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
} else if (!context || context.jquery) {
return (context || rootjQuery).find(selector);
} else {
return this
.constructor(context)
.find(selector);
}
} else if (jQuery.isFunction(selector)) {
return rootjQuery.ready(selector);
}
if (selector.selector !== undefined) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray(selector, this);
},
jquery : "1.8.2",
last : function () {
return this.eq(-1);
},
length : 0,
map : function (callback) {
return this.pushStack(jQuery.map(this, function (elem, i) {
return callback.call(elem, i, elem);
}));
},
push : core_push,
pushStack : function (elems, name, selector) {
var ret = jQuery.merge(this.constructor(), elems);
ret.prevObject = this;
ret.context = this.context;
if (name === "find") {
ret.selector = this.selector + (this.selector
? " "
: "") + selector;
} else if (name) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
return ret;
},
ready : function (fn) {
jQuery
.ready
.promise()
.done(fn);
return this;
},
selector : "",
size : function () {
return this.length;
},
slice : function () {
return this.pushStack(core_slice.apply(this, arguments), "slice", core_slice.call(arguments).join(","));
},
sort : [].sort,
splice : [].splice,
toArray : function () {
return core_slice.call(this);
}
};
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function () {
var options,
name,
src,
copy,
copyIsArray,
clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
if (typeof target === "boolean") {
deep = target;
target = arguments[1] || {};
i = 2;
}
if (typeof target !== "object" && !jQuery.isFunction(target)) {
target = {};
}
if (length === i) {
target = this;
i -= 1;
}
for (; i < length; i += 1) {
if ((options = arguments[i]) != null) {
for (name in options) {
src = target[name];
copy = options[name];
if (target === copy) {
continue;
}
if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && jQuery.isArray(src)
? src
: [];
} else {
clone = src && jQuery.isPlainObject(src)
? src
: {};
}
target[name] = jQuery.extend(deep, clone, copy);
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
return target;
};
jQuery.extend({
access : function (elems, fn, key, value, chainable, emptyGet, pass) {
var exec,
bulk = key == null,
i = 0,
length = elems.length;
if (key && typeof key === "object") {
for (i in key) {
jQuery.access(elems, fn, i, key[i], 1, emptyGet, value);
}
chainable = 1;
} else if (value !== undefined) {
exec = pass === undefined && jQuery.isFunction(value);
if (bulk) {
if (exec) {
exec = fn;
fn = function (elem, key, value) {
return exec.call(jQuery(elem), value);
};
} else {
fn.call(elems, value);
fn = null;
}
}
if (fn) {
for (; i < length; i += 1) {
fn(elems[i], key, exec
? value.call(elems[i], i, fn(elems[i], key))
: value,
pass);
}
}
chainable = 1;
}
return chainable
? elems
: bulk
? fn.call(elems)
: length
? fn(elems[0], key)
: emptyGet;
},
camelCase : function (string) {
return string
.replace(rmsPrefix, "ms-")
.replace(rdashAlpha, fcamelCase);
},
each : function (obj, callback, args) {
var name,
i = 0,
length = obj.length,
isObj = length === undefined || jQuery.isFunction(obj);
if (args) {
if (isObj) {
for (name in obj) {
if (callback.apply(obj[name], args) === false) {
break;
}
}
} else {
for (; i < length;) {
if (callback.apply(obj[i++], args) === false) {
break;
}
}
}
} else {
if (isObj) {
for (name in obj) {
if (callback.call(obj[name], name, obj[name]) === false) {
break;
}
}
} else {
for (; i < length;) {
if (callback.call(obj[i], i, obj[i++]) === false) {
break;
}
}
}
}
return obj;
},
error : function (msg) {
throw new Error(msg);
},
globalEval : function (data) {
if (data && core_rnotwhite.test(data)) {
(window.execScript || function (data) {
window["eval"].call(window, data);
})(data);
}
},
grep : function (elems, callback, inv) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
for (; i < length; i += 1) {
retVal = !!callback(elems[i], i);
if (inv !== retVal) {
ret.push(elems[i]);
}
}
return ret;
},
guid : 1,
holdReady : function (hold) {
if (hold) {
jQuery.readyWait += 1;
} else {
jQuery.ready(true);
}
},
inArray : function (elem, arr, i) {
var len;
if (arr) {
if (core_indexOf) {
return core_indexOf.call(arr, elem, i);
}
len = arr.length;
i = i
? i < 0
? Math.max(0, len + i)
: i
: 0;
for (; i < len; i += 1) {
if (i in arr && arr[i] === elem) {
return i;
}
}
}
return -1;
},
isArray : Array.isArray || function (obj) {
return jQuery.type(obj) === "array";
},
isEmptyObject: function (obj) {
var name;
for (name in obj) {
return false;
}
return true;
},
isFunction : function (obj) {
return jQuery.type(obj) === "function";
},
isNumeric : function (obj) {
return !isNaN(parseFloat(obj)) && isFinite(obj);
},
isPlainObject: function (obj) {
if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
return false;
}
try {
if (obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
} catch (e) {
return false;
}
var key;
for (key in obj) {}
return key === undefined || core_hasOwn.call(obj, key);
},
isReady : false,
isWindow : function (obj) {
return obj != null && obj == obj.window;
},
makeArray : function (arr, results) {
var type,
ret = results || [];
if (arr != null) {
type = jQuery.type(arr);
if (arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow(arr)) {
core_push.call(ret, arr);
} else {
jQuery.merge(ret, arr);
}
}
return ret;
},
map : function (elems, callback, arg) {
var value,
key,
ret = [],
i = 0,
length = elems.length,
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ((length > 0 && elems[0] && elems[length - 1]) || length === 0 || jQuery.isArray(elems));
if (isArray) {
for (; i < length; i += 1) {
value = callback(elems[i], i, arg);
if (value != null) {
ret[ret.length] = value;
}
}
} else {
for (key in elems) {
value = callback(elems[key], key, arg);
if (value != null) {
ret[ret.length] = value;
}
}
}
return ret
.concat
.apply([], ret);
},
merge : function (first, second) {
var l = second.length,
i = first.length,
j = 0;
if (typeof l === "number") {
for (; j < l; j += 1) {
first[i++] = second[j];
}
} else {
while (second[j] !== undefined) {
first[i++] = second[j++];
}
}
first.length = i;
return first;
},
noConflict : function (deep) {
if (window.$ === jQuery) {
window.$ = _$;
}
if (deep && window.jQuery === jQuery) {
window.jQuery = _jQuery;
}
return jQuery;
},
nodeName : function (elem, name) {
return elem.nodeName && elem
.nodeName
.toLowerCase() === name.toLowerCase();
},
noop : function () {},
now : function () {
return (new Date()).getTime();
},
parseHTML : function (data, context, scripts) {
var parsed;
if (!data || typeof data !== "string") {
return null;
}
if (typeof context === "boolean") {
scripts = context;
context = 0;
}
context = context || document;
if ((parsed = rsingleTag.exec(data))) {
return [context.createElement(parsed[1])];
}
parsed = jQuery.buildFragment([data], context, scripts
? null
: []);
return jQuery.merge([], (parsed.cacheable
? jQuery.clone(parsed.fragment)
: parsed.fragment).childNodes);
},
parseJSON : function (data) {
if (!data || typeof data !== "string") {
return null;
}
data = jQuery.trim(data);
if (window.JSON && window.JSON.parse) {
return window
.JSON
.parse(data);
}
if (rvalidchars.test(data.replace(rvalidescape, "@").replace(rvalidtokens, "]").replace(rvalidbraces, ""))) {
return (new Function("return " + data))();
}
jQuery.error("Invalid JSON: " + data);
},
parseXML : function (data) {
var xml,
tmp;
if (!data || typeof data !== "string") {
return null;
}
try {
if (window.DOMParser) {
tmp = new DOMParser();
xml = tmp.parseFromString(data, "text/xml");
} else {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = "false";
xml.loadXML(data);
}
} catch (e) {
xml = undefined;
}
if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) {
jQuery.error("Invalid XML: " + data);
}
return xml;
},
proxy : function (fn, context) {
var tmp,
args,
proxy;
if (typeof context === "string") {
tmp = fn[context];
context = fn;
fn = tmp;
}
if (!jQuery.isFunction(fn)) {
return undefined;
}
args = core_slice.call(arguments, 2);
proxy = function () {
return fn.apply(context, args.concat(core_slice.call(arguments)));
};
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
ready : function (wait) {
if (wait === true
? --jQuery.readyWait
: jQuery.isReady) {
return;
}
if (!document.body) {
return setTimeout(jQuery.ready, 1);
}
jQuery.isReady = true;
if (wait !== true && --jQuery.readyWait > 0) {
return;
}
readyList.resolveWith(document, [jQuery]);
if (jQuery.fn.trigger) {
jQuery(document)
.trigger("ready")
.off("ready");
}
},
readyWait : 1,
trim : core_trim && !core_trim.call("\uFEFF\xA0")
? function (text) {
return text == null
? ""
: core_trim.call(text);
}
: function (text) {
return text == null
? ""
: (text + "").replace(rtrim, "");
},
type : function (obj) {
return obj == null
? String(obj)
: class2type[core_toString.call(obj)] || "object";
}
});
jQuery.ready.promise = function (obj) {
if (!readyList) {
readyList = jQuery.Deferred();
if (document.readyState === "complete") {
setTimeout(jQuery.ready, 1);
} else if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", DOMContentLoaded, false);
window.addEventListener("load", jQuery.ready, false);
} else {
document.attachEvent("onreadystatechange", DOMContentLoaded);
window.attachEvent("onload", jQuery.ready);
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch (e) {}
if (top && top.doScroll) {
(function doScrollCheck() {
if (!jQuery.isReady) {
try {
top.doScroll("left");
} catch (e) {
return setTimeout(doScrollCheck, 50);
}
jQuery.ready();
}
})();
}
}
}
return readyList.promise(obj);
};
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (i, name) {
class2type["[object " + name + "]"] = name.toLowerCase();
});
rootjQuery = jQuery(document);
var optionsCache = {};
function createOptions(options) {
var object = optionsCache[options] = {};
jQuery.each(options.split(core_rspace), function (_, flag) {
object[flag] = true;
});
return object;
}
jQuery.Callbacks = function (options) {
options = typeof options === "string"
? (optionsCache[options] || createOptions(options))
: jQuery.extend({}, options);
var memory,
fired,
firing,
firingStart,
firingLength,
firingIndex,
list = [],
stack = !options.once && [],
fire = function (data) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for (; list && firingIndex < firingLength; firingIndex += 1) {
if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
memory = false;
break;
}
}
firing = false;
if (list) {
if (stack) {
if (stack.length) {
fire(stack.shift());
}
} else if (memory) {
list = [];
} else {
self.disable();
}
}
},
self = {
add : function () {
if (list) {
var start = list.length;
(function add(args) {
jQuery.each(args, function (_, arg) {
var type = jQuery.type(arg);
if (type === "function" && (!options.unique || !self.has(arg))) {
list.push(arg);
} else if (arg && arg.length && type !== "string") {
add(arg);
}
});
})(arguments);
if (firing) {
firingLength = list.length;
} else if (memory) {
firingStart = start;
fire(memory);
}
}
return this;
},
disable : function () {
list = stack = memory = undefined;
return this;
},
disabled: function () {
return !list;
},
empty : function () {
list = [];
return this;
},
fire : function () {
self.fireWith(this, arguments);
return this;
},
fired : function () {
return !!fired;
},
fireWith: function (context, args) {
args = args || [];
args = [
context, args.slice
? args.slice()
: args
];
if (list && (!fired || stack)) {
if (firing) {
stack.push(args);
} else {
fire(args);
}
}
return this;
},
has : function (fn) {
return jQuery.inArray(fn, list) > -1;
},
lock : function () {
stack = undefined;
if (!memory) {
self.disable();
}
return this;
},
locked : function () {
return !stack;
},
remove : function () {
if (list) {
jQuery.each(arguments, function (_, arg) {
var index;
while ((index = jQuery.inArray(arg, list, index)) > -1) {
list.splice(index, 1);
if (firing) {
if (index <= firingLength) {
firingLength -= 1;
}
if (index <= firingIndex) {
firingIndex -= 1;
}
}
}
});
}
return this;
}
};
return self;
};
jQuery.extend({
Deferred: function (func) {
var tuples = [
[
"resolve", "done", jQuery.Callbacks("once memory"), "resolved"
],
[
"reject", "fail", jQuery.Callbacks("once memory"), "rejected"
],
[
"notify", "progress", jQuery.Callbacks("memory")
]
],
state = "pending",
promise = {
always : function () {
deferred
.done(arguments)
.fail(arguments);
return this;
},
promise: function (obj) {
return obj != null
? jQuery.extend(obj, promise)
: promise;
},
state : function () {
return state;
},
then : function () {
var fns = arguments;
return jQuery
.Deferred(function (newDefer) {
jQuery.each(tuples, function (i, tuple) {
var action = tuple[0],
fn = fns[i];
deferred[tuple[1]](jQuery.isFunction(fn)
? function () {
var returned = fn.apply(this, arguments);
if (returned && jQuery.isFunction(returned.promise)) {
returned
.promise()
.done(newDefer.resolve)
.fail(newDefer.reject)
.progress(newDefer.notify);
} else {
newDefer[action + "With"](this === deferred
? newDefer
: this,
[returned]);
}
}
: newDefer[action]);
});
fns = null;
})
.promise();
}
},
deferred = {};
promise.pipe = promise.then;
jQuery.each(tuples, function (i, tuple) {
var list = tuple[2],
stateString = tuple[3];
promise[tuple[1]] = list.add;
if (stateString) {
list.add(function () {
state = stateString;
}, tuples[i ^ 1][2].disable, tuples[2][2].lock);
}
deferred[tuple[0]] = list.fire;
deferred[tuple[0] + "With"] = list.fireWith;
});
promise.promise(deferred);
if (func) {
func.call(deferred, deferred);
}
return deferred;
},
when : function (subordinate) {
var i = 0,
resolveValues = core_slice.call(arguments),
length = resolveValues.length,
remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise))
? length
: 0,
deferred = remaining === 1
? subordinate
: jQuery.Deferred(),
updateFunc = function (i, contexts, values) {
return function (value) {
contexts[i] = this;
values[i] = arguments.length > 1
? core_slice.call(arguments)
: value;
if (values === progressValues) {
deferred.notifyWith(contexts, values);
} else if (!(remaining -= 1)) {
deferred.resolveWith(contexts, values);
}
};
},
progressValues,
progressContexts,
resolveContexts;
if (length > 1) {
progressValues = [length];
progressContexts = [length];
resolveContexts = [length];
for (; i < length; i += 1) {
if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
resolveValues[i]
.promise()
.done(updateFunc(i, resolveContexts, resolveValues))
.fail(deferred.reject)
.progress(updateFunc(i, progressContexts, progressValues));
} else {
remaining -= 1;
}
}
}
if (!remaining) {
deferred.resolveWith(resolveContexts, resolveValues);
}
return deferred.promise();
}
});
jQuery.support = (function () {
var support,
all,
a,
select,
opt,
input,
fragment,
eventName,
i,
isSupported,
clickFn,
div = document.createElement("div");
div.setAttribute("className", "t");
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[0];
a.style.cssText = "top:1px;float:left;opacity:.5";
if (!all || !all.length) {
return {};
}
select = document.createElement("select");
opt = select.appendChild(document.createElement("option"));
input = div.getElementsByTagName("input")[0];
support = {
boxModel : (document.compatMode === "CSS1Compat"),
boxSizingReliable : true,
changeBubbles : true,
checkOn : (input.value === "on"),
cssFloat : !!a.style.cssFloat,
deleteExpando : true,
enctype : !!document
.createElement("form")
.enctype,
focusinBubbles : false,
getSetAttribute : div.className !== "t",
hrefNormalized : (a.getAttribute("href") === "/a"),
html5Clone : document
.createElement("nav")
.cloneNode(true)
.outerHTML !== "<:nav></:nav>",
htmlSerialize : !!div
.getElementsByTagName("link")
.length,
inlineBlockNeedsLayout: false,
leadingWhitespace : (div.firstChild.nodeType === 3),
noCloneEvent : true,
opacity : /^0.5/.test(a.style.opacity),
optSelected : opt.selected,
pixelPosition : false,
reliableMarginRight : true,
shrinkWrapBlocks : false,
style : /top/.test(a.getAttribute("style")),
submitBubbles : true,
tbody : !div
.getElementsByTagName("tbody")
.length
};
input.checked = true;
support.noCloneChecked = input
.cloneNode(true)
.checked;
select.disabled = true;
support.optDisabled = !opt.disabled;
try {
delete div.test;
} catch (e) {
support.deleteExpando = false;
}
if (!div.addEventListener && div.attachEvent && div.fireEvent) {
div.attachEvent("onclick", clickFn = function () {
support.noCloneEvent = false;
});
div
.cloneNode(true)
.fireEvent("onclick");
div.detachEvent("onclick", clickFn);
}
input = document.createElement("input");
input.value = "t";
input.setAttribute("type", "radio");
support.radioValue = input.value === "t";
input.setAttribute("checked", "checked");
input.setAttribute("name", "t");
div.appendChild(input);
fragment = document.createDocumentFragment();
fragment.appendChild(div.lastChild);
support.checkClone = fragment
.cloneNode(true)
.cloneNode(true)
.lastChild
.checked;
support.appendChecked = input.checked;
fragment.removeChild(input);
fragment.appendChild(div);
if (div.attachEvent) {
for (i in {change: true, focusin: true, submit: true}) {
eventName = "on" + i;
isSupported = (eventName in div);
if (!isSupported) {
div.setAttribute(eventName, "return;");
isSupported = (typeof div[eventName] === "function");
}
support[i + "Bubbles"] = isSupported;
}
}
jQuery(function () {
var container,
div,
tds,
marginDiv,
divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
body = document.getElementsByTagName("body")[0];
if (!body) {
return;
}
container = document.createElement("div");
container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1" +
"px";
body.insertBefore(container, body.firstChild);
div = document.createElement("div");
container.appendChild(div);
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
tds[0].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = (tds[0].offsetHeight === 0);
tds[0].style.display = "";
tds[1].style.display = "none";
support.reliableHiddenOffsets = isSupported && (tds[0].offsetHeight === 0);
div.innerHTML = "";
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:absolut" +
"e;top:1%;";
support.boxSizing = (div.offsetWidth === 4);
support.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== 1);
if (window.getComputedStyle) {
support.pixelPosition = (window.getComputedStyle(div, null) || {}).top !== "1%";
support.boxSizingReliable = (window.getComputedStyle(div, null) || {
width: "4px"
}).width === "4px";
marginDiv = document.createElement("div");
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
div.appendChild(marginDiv);
support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight);
}
if (typeof div.style.zoom !== "undefined") {
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = (div.offsetWidth === 3);
div.style.display = "block";
div.style.overflow = "visible";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = (div.offsetWidth !== 3);
container.style.zoom = 1;
}
body.removeChild(container);
container = div = tds = marginDiv = null;
});
fragment.removeChild(div);
all = a = select = opt = input = fragment = div = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
jQuery.extend({
_data : function (elem, name, data) {
return jQuery.data(elem, name, data, true);
},
acceptData: function (elem) {
var noData = elem.nodeName && jQuery.noData[
elem
.nodeName
.toLowerCase()
];
return !noData || noData !== true && elem.getAttribute("classid") === noData;
},
cache : {},
data : function (elem, name, data, pvt) {
if (!jQuery.acceptData(elem)) {
return;
}
var thisCache,
ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
isNode = elem.nodeType,
cache = isNode
? jQuery.cache
: elem,
id = isNode
? elem[internalKey]
: elem[internalKey] && internalKey;
if ((!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined) {
return;
}
if (!id) {
if (isNode) {
elem[internalKey] = id = jQuery
.deletedIds
.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if (!cache[id]) {
cache[id] = {};
if (!isNode) {
cache[id].toJSON = jQuery.noop;
}
}
if (typeof name === "object" || typeof name === "function") {
if (pvt) {
cache[id] = jQuery.extend(cache[id], name);
} else {
cache[id].data = jQuery.extend(cache[id].data, name);
}
}
thisCache = cache[id];
if (!pvt) {
if (!thisCache.data) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if (data !== undefined) {
thisCache[jQuery.camelCase(name)] = data;
}
if (getByName) {
ret = thisCache[name];
if (ret == null) {
ret = thisCache[jQuery.camelCase(name)];
}
} else {
ret = thisCache;
}
return ret;
},
deletedIds: [],
expando : "jQuery" + (jQuery.fn.jquery + Math.random()).replace(/\D/g, ""),
hasData : function (elem) {
elem = elem.nodeType
? jQuery.cache[elem[jQuery.expando]]
: elem[jQuery.expando];
return !!elem && !isEmptyDataObject(elem);
},
noData : {
"applet": true,
"embed" : true,
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
},
removeData: function (elem, name, pvt) {
if (!jQuery.acceptData(elem)) {
return;
}
var thisCache,
i,
l,
isNode = elem.nodeType,
cache = isNode
? jQuery.cache
: elem,
id = isNode
? elem[jQuery.expando]
: jQuery.expando;
if (!cache[id]) {
return;
}
if (name) {
thisCache = pvt
? cache[id]
: cache[id].data;
if (thisCache) {
if (!jQuery.isArray(name)) {
if (name in thisCache) {
name = [name];
} else {
name = jQuery.camelCase(nam