guy 7 years ago
parent
commit
cf96f485d2
  1. 1665
      dist/base.js
  2. 1819
      dist/bundle.js
  3. 20
      dist/bundle.min.js
  4. 4
      dist/case.js
  5. 150
      dist/core.js
  6. 7
      dist/fix/fix.compact.js
  7. 6
      dist/fix/fix.js
  8. 1228
      src/base/formula/codemirror/codemirror.js
  9. 2
      src/base/sql/codemirrior/sql-mode.js
  10. 284
      src/base/svg/raphael.js
  11. 117
      src/base/tree/ztree/jquery.ztree.core-3.5.js
  12. 34
      src/base/tree/ztree/jquery.ztree.excheck-3.5.js
  13. 4
      src/case/clipboard/clipboard.js
  14. 150
      src/core/jquery.js

1665
dist/base.js vendored

File diff suppressed because it is too large Load Diff

1819
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

20
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4
dist/case.js vendored

@ -2627,7 +2627,7 @@ try {// IE8下会抛错
function _interopRequireDefault (obj) { function _interopRequireDefault (obj) {
return obj && obj.__esModule ? obj : { return obj && obj.__esModule ? obj : {
default: obj "default": obj
}; };
} }
@ -2861,7 +2861,7 @@ try {// IE8下会抛错
function _interopRequireDefault (obj) { function _interopRequireDefault (obj) {
return obj && obj.__esModule ? obj : { return obj && obj.__esModule ? obj : {
default: obj "default": obj
}; };
} }

150
dist/core.js vendored

@ -169,7 +169,7 @@
return this; return this;
// HANDLE: $(#id) // HANDLE: $(#id)
} } else {
elem = document.getElementById( match[2] ); elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns // Check parentNode to catch when Blackberry 4.6 returns
@ -189,7 +189,7 @@
this.context = document; this.context = document;
this.selector = selector; this.selector = selector;
return this; return this;
}
// HANDLE: $(expr, $(...)) // HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) { } else if ( !context || context.jquery ) {
@ -197,9 +197,9 @@
// HANDLE: $(expr, context) // HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr) // (which is just equivalent to: $(context).find(expr)
} } else {
return this.constructor( context ).find( selector ); return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement) // HANDLE: $(DOMElement)
} else if ( selector.nodeType ) { } else if ( selector.nodeType ) {
@ -1739,10 +1739,10 @@
// The following elements throw uncatchable exceptions if you // The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them. // attempt to add expando properties to them.
noData: { noData: {
embed: true, "embed": true,
// Ban all objects except for Flash (which handle expandos) // Ban all objects except for Flash (which handle expandos)
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet: true "applet": true
}, },
hasData: function( elem ) { hasData: function( elem ) {
@ -2427,8 +2427,8 @@
propFix: { propFix: {
tabindex: "tabIndex", tabindex: "tabIndex",
readonly: "readOnly", readonly: "readOnly",
for: "htmlFor", "for": "htmlFor",
class: "className", "class": "className",
maxlength: "maxLength", maxlength: "maxLength",
cellspacing: "cellSpacing", cellspacing: "cellSpacing",
cellpadding: "cellPadding", cellpadding: "cellPadding",
@ -2460,18 +2460,18 @@
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret; return ret;
} } else {
return ( elem[ name ] = value ); return ( elem[ name ] = value );
} }
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret; return ret;
} } else {
return elem[ name ]; return elem[ name ];
}
}
}, },
propHooks: { propHooks: {
@ -3780,18 +3780,18 @@
ridentifier = new RegExp( "^" + identifier + "$" ), ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = { matchExpr = {
ID: new RegExp( "^#(" + characterEncoding + ")" ), "ID": new RegExp( "^#(" + characterEncoding + ")" ),
CLASS: new RegExp( "^\\.(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
NAME: new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
TAG: new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
ATTR: new RegExp( "^" + attributes ), "ATTR": new RegExp( "^" + attributes ),
PSEUDO: new RegExp( "^" + pseudos ), "PSEUDO": new RegExp( "^" + pseudos ),
CHILD: new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is() // For use in libraries implementing .is()
// We use this for POS matching in `select` // We use this for POS matching in `select`
needsContext: new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
}, },
@ -4088,10 +4088,10 @@
}) ? }) ?
{} : {} :
{ {
href: function ( elem ) { "href": function( elem ) {
return elem.getAttribute( "href", 2 ); return elem.getAttribute( "href", 2 );
}, },
type: function ( elem ) { "type": function( elem ) {
return elem.getAttribute("type"); return elem.getAttribute("type");
} }
}; };
@ -4525,12 +4525,12 @@
// innerText usage removed for consistency of new lines (see #11153) // innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) { if ( typeof elem.textContent === "string" ) {
return elem.textContent; return elem.textContent;
} } else {
// Traverse its children // Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem ); ret += getText( elem );
} }
}
} else if ( nodeType === 3 || nodeType === 4 ) { } else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue; return elem.nodeValue;
} }
@ -4558,7 +4558,7 @@
}, },
preFilter: { preFilter: {
ATTR: function ( match ) { "ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape ); match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted // Move the given value to match[3] whether quoted or unquoted
@ -4571,7 +4571,7 @@
return match.slice( 0, 4 ); return match.slice( 0, 4 );
}, },
CHILD: function ( match ) { "CHILD": function( match ) {
/* matches from matchExpr["CHILD"] /* matches from matchExpr["CHILD"]
1 type (only|nth|...) 1 type (only|nth|...)
2 what (child|of-type) 2 what (child|of-type)
@ -4603,7 +4603,7 @@
return match; return match;
}, },
PSEUDO: function ( match ) { "PSEUDO": function( match ) {
var excess, var excess,
unquoted = !match[5] && match[2]; unquoted = !match[5] && match[2];
@ -4634,7 +4634,7 @@
filter: { filter: {
TAG: function ( nodeName ) { "TAG": function( nodeName ) {
if ( nodeName === "*" ) { if ( nodeName === "*" ) {
return function() { return true; }; return function() { return true; };
} }
@ -4645,7 +4645,7 @@
}; };
}, },
CLASS: function ( className ) { "CLASS": function( className ) {
var pattern = classCache[ className + " " ]; var pattern = classCache[ className + " " ];
return pattern || return pattern ||
@ -4655,7 +4655,7 @@
}); });
}, },
ATTR: function ( name, operator, check ) { "ATTR": function( name, operator, check ) {
return function( elem ) { return function( elem ) {
var result = Sizzle.attr( elem, name ); var result = Sizzle.attr( elem, name );
@ -4679,7 +4679,7 @@
}; };
}, },
CHILD: function ( type, what, argument, first, last ) { "CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth", var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last", forward = type.slice( -4 ) !== "last",
ofType = what === "of-type"; ofType = what === "of-type";
@ -4768,7 +4768,7 @@
}; };
}, },
PSEUDO: function ( pseudo, argument ) { "PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive // pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes // http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
@ -4808,7 +4808,7 @@
pseudos: { pseudos: {
// Potentially complex pseudos // Potentially complex pseudos
not: markFunction(function ( selector ) { "not": markFunction(function( selector ) {
// Trim the selector passed to compile // Trim the selector passed to compile
// to avoid treating leading and trailing // to avoid treating leading and trailing
// spaces as combinators // spaces as combinators
@ -4836,13 +4836,13 @@
}; };
}), }),
has: markFunction(function ( selector ) { "has": markFunction(function( selector ) {
return function( elem ) { return function( elem ) {
return Sizzle( selector, elem ).length > 0; return Sizzle( selector, elem ).length > 0;
}; };
}), }),
contains: markFunction(function ( text ) { "contains": markFunction(function( text ) {
return function( elem ) { return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
}; };
@ -4855,7 +4855,7 @@
// The matching of C against the element's language value is performed case-insensitively. // The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name." // The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo // http://www.w3.org/TR/selectors/#lang-pseudo
lang: markFunction( function ( lang ) { "lang": markFunction( function( lang ) {
// lang value must be a valid identifider // lang value must be a valid identifider
if ( !ridentifier.test(lang || "") ) { if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang ); Sizzle.error( "unsupported lang: " + lang );
@ -4877,36 +4877,36 @@
}), }),
// Miscellaneous // Miscellaneous
target: function ( elem ) { "target": function( elem ) {
var hash = window.location && window.location.hash; var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id; return hash && hash.slice( 1 ) === elem.id;
}, },
root: function ( elem ) { "root": function( elem ) {
return elem === docElem; return elem === docElem;
}, },
focus: function ( elem ) { "focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
}, },
// Boolean properties // Boolean properties
enabled: function ( elem ) { "enabled": function( elem ) {
return elem.disabled === false; return elem.disabled === false;
}, },
disabled: function ( elem ) { "disabled": function( elem ) {
return elem.disabled === true; return elem.disabled === true;
}, },
checked: function ( elem ) { "checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements // In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase(); var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
}, },
selected: function ( elem ) { "selected": function( elem ) {
// Accessing this property makes selected-by-default // Accessing this property makes selected-by-default
// options in Safari work properly // options in Safari work properly
if ( elem.parentNode ) { if ( elem.parentNode ) {
@ -4917,7 +4917,7 @@
}, },
// Contents // Contents
empty: function ( elem ) { "empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo // http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others // not comment, processing instructions, or others
@ -4931,25 +4931,25 @@
return true; return true;
}, },
parent: function ( elem ) { "parent": function( elem ) {
return !Expr.pseudos["empty"]( elem ); return !Expr.pseudos["empty"]( elem );
}, },
// Element/input types // Element/input types
header: function ( elem ) { "header": function( elem ) {
return rheader.test( elem.nodeName ); return rheader.test( elem.nodeName );
}, },
input: function ( elem ) { "input": function( elem ) {
return rinputs.test( elem.nodeName ); return rinputs.test( elem.nodeName );
}, },
button: function ( elem ) { "button": function( elem ) {
var name = elem.nodeName.toLowerCase(); var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button"; return name === "input" && elem.type === "button" || name === "button";
}, },
text: function ( elem ) { "text": function( elem ) {
var attr; var attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case // use getAttribute instead to test this case
@ -4959,19 +4959,19 @@
}, },
// Position-in-collection // Position-in-collection
first: createPositionalPseudo(function () { "first": createPositionalPseudo(function() {
return [ 0 ]; return [ 0 ];
}), }),
last: createPositionalPseudo(function ( matchIndexes, length ) { "last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ]; return [ length - 1 ];
}), }),
eq: createPositionalPseudo(function ( matchIndexes, length, argument ) { "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ]; return [ argument < 0 ? argument + length : argument ];
}), }),
even: createPositionalPseudo(function ( matchIndexes, length ) { "even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0; var i = 0;
for ( ; i < length; i += 2 ) { for ( ; i < length; i += 2 ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4979,7 +4979,7 @@
return matchIndexes; return matchIndexes;
}), }),
odd: createPositionalPseudo(function ( matchIndexes, length ) { "odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1; var i = 1;
for ( ; i < length; i += 2 ) { for ( ; i < length; i += 2 ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4987,7 +4987,7 @@
return matchIndexes; return matchIndexes;
}), }),
lt: createPositionalPseudo(function ( matchIndexes, length, argument ) { "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument; var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) { for ( ; --i >= 0; ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4995,7 +4995,7 @@
return matchIndexes; return matchIndexes;
}), }),
gt: createPositionalPseudo(function ( matchIndexes, length, argument ) { "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument; var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) { for ( ; ++i < length; ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -5811,9 +5811,9 @@
if ( isSimple.test( qualifier ) ) { if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep); return jQuery.filter(qualifier, filtered, !keep);
} } else {
qualifier = jQuery.filter( qualifier, filtered ); qualifier = jQuery.filter( qualifier, filtered );
}
} }
return jQuery.grep(elements, function( elem ) { return jQuery.grep(elements, function( elem ) {
@ -6183,7 +6183,7 @@
dataType: "script", dataType: "script",
async: false, async: false,
global: false, global: false,
throws: true "throws": true
}); });
} else { } else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
@ -6781,22 +6781,22 @@
// Exclude the following css properties to add px // Exclude the following css properties to add px
cssNumber: { cssNumber: {
columnCount: true, "columnCount": true,
fillOpacity: true, "fillOpacity": true,
fontWeight: true, "fontWeight": true,
lineHeight: true, "lineHeight": true,
opacity: true, "opacity": true,
orphans: true, "orphans": true,
widows: true, "widows": true,
zIndex: true, "zIndex": true,
zoom: true "zoom": true
}, },
// Add in properties whose names you wish to fix before // Add in properties whose names you wish to fix before
// setting or getting the value // setting or getting the value
cssProps: { cssProps: {
// normalize float css property // normalize float css property
float: jQuery.support.cssFloat ? "cssFloat" : "styleFloat" "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
}, },
// Get and set the style property on a DOM Node // Get and set the style property on a DOM Node
@ -7227,7 +7227,7 @@
if ( computed ) { if ( computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block // Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { display: "inline-block" }, return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] ); curCSS, [ elem, "marginRight" ] );
} }
} }
@ -8734,10 +8734,10 @@
if ( percent < 1 && length ) { if ( percent < 1 && length ) {
return remaining; return remaining;
} } else {
deferred.resolveWith( elem, [ animation ] ); deferred.resolveWith( elem, [ animation ] );
return false; return false;
}
}, },
animation = deferred.promise({ animation = deferred.promise({
elem: elem, elem: elem,

7
dist/fix/fix.compact.js vendored

@ -98,7 +98,10 @@
}); });
}); });
this._watchers && (this._watchers = []); this._watchers && (this._watchers = []);
this.store && (this.store._parent = null, this.store = null); if (this.store) {
this.store._parent && (this.store._parent = null);
this.store = null;
}
}; };
_.each(["_mount"], function (name) { _.each(["_mount"], function (name) {
@ -111,6 +114,7 @@
}); });
}); });
if (BI.isIE9Below()) {
_.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min", _.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition", "sortBy", "groupBy", "indexBy", "countBy", "partition",
"keys", "allKeys", "values", "pairs", "invert", "keys", "allKeys", "values", "pairs", "invert",
@ -124,5 +128,6 @@
}) : old.apply(this, arguments); }) : old.apply(this, arguments);
}; };
}); });
}
BI.watch = Fix.watch; BI.watch = Fix.watch;
}()); }());

6
dist/fix/fix.js vendored

@ -401,10 +401,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} else { } else {
this.model = this.walk(value); this.model = this.walk(value);
} }
try { if (isIE9Below) {
def(this.model, "__ob__", this);
} catch (e) {
this.model['__ob__'] = this; this.model['__ob__'] = this;
} else {
def(this.model, "__ob__", this);
} }
} }

1228
src/base/formula/codemirror/codemirror.js

File diff suppressed because it is too large Load Diff

2
src/base/sql/codemirrior/sql-mode.js

@ -10,7 +10,7 @@
"use strict"; "use strict";
var client = parserConfig.client || {}, var client = parserConfig.client || {},
atoms = parserConfig.atoms || {false: true, true: true, null: true}, atoms = parserConfig.atoms || {"false": true, "true": true, "null": true},
builtin = parserConfig.builtin || {}, builtin = parserConfig.builtin || {},
keywords = parserConfig.keywords || {}, keywords = parserConfig.keywords || {},
operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/,

284
src/base/svg/raphael.js

@ -68,14 +68,12 @@
errors = []; errors = [];
current_event = name; current_event = name;
stop = 0; stop = 0;
for (var i = 0, ii = listeners.length; i < ii; i++) { for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
if ("zIndex" in listeners[i]) {
indexed.push(listeners[i].zIndex); indexed.push(listeners[i].zIndex);
if (listeners[i].zIndex < 0) { if (listeners[i].zIndex < 0) {
queue[listeners[i].zIndex] = listeners[i]; queue[listeners[i].zIndex] = listeners[i];
} }
} }
}
indexed.sort(numsort); indexed.sort(numsort);
while (indexed[z] < 0) { while (indexed[z] < 0) {
l = queue[indexed[z++]]; l = queue[indexed[z++]];
@ -100,7 +98,7 @@
if (stop) { if (stop) {
break; break;
} }
} while (l); } while (l)
} else { } else {
queue[l.zIndex] = l; queue[l.zIndex] = l;
} }
@ -187,7 +185,7 @@
\*/ \*/
eve.on = function (name, f) { eve.on = function (name, f) {
name = String(name); name = String(name);
if (typeof f !== "function") { if (typeof f != "function") {
return function () {}; return function () {};
} }
var names = name.split(separator), var names = name.split(separator),
@ -197,11 +195,9 @@
e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}}); e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
} }
e.f = e.f || []; e.f = e.f || [];
for (i = 0, ii = e.f.length; i < ii; i++) { for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
if (e.f[i] == f) {
return fun; return fun;
} }
}
e.f.push(f); e.f.push(f);
return function (zIndex) { return function (zIndex) {
if (+zIndex == +zIndex) { if (+zIndex == +zIndex) {
@ -310,12 +306,10 @@
splice.push(e[names[i]]); splice.push(e[names[i]]);
} }
} else { } else {
for (key in e) { for (key in e) if (e[has](key)) {
if (e[has](key)) {
splice.push(e[key]); splice.push(e[key]);
} }
} }
}
cur.splice.apply(cur, splice); cur.splice.apply(cur, splice);
} }
} }
@ -324,34 +318,26 @@
while (e.n) { while (e.n) {
if (f) { if (f) {
if (e.f) { if (e.f) {
for (j = 0, jj = e.f.length; j < jj; j++) { for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
if (e.f[j] == f) {
e.f.splice(j, 1); e.f.splice(j, 1);
break; break;
} }
}
!e.f.length && delete e.f; !e.f.length && delete e.f;
} }
for (key in e.n) { for (key in e.n) if (e.n[has](key) && e.n[key].f) {
if (e.n[has](key) && e.n[key].f) {
var funcs = e.n[key].f; var funcs = e.n[key].f;
for (j = 0, jj = funcs.length; j < jj; j++) { for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
if (funcs[j] == f) {
funcs.splice(j, 1); funcs.splice(j, 1);
break; break;
} }
}
!funcs.length && delete e.n[key].f; !funcs.length && delete e.n[key].f;
} }
}
} else { } else {
delete e.f; delete e.f;
for (key in e.n) { for (key in e.n) if (e.n[has](key) && e.n[key].f) {
if (e.n[has](key) && e.n[key].f) {
delete e.n[key].f; delete e.n[key].f;
} }
} }
}
e = e.n; e = e.n;
} }
} }
@ -468,17 +454,17 @@
return loaded ? first() : eve.on("raphael.DOMload", first); return loaded ? first() : eve.on("raphael.DOMload", first);
} else if (R.is(first, array)) { } else if (R.is(first, array)) {
return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first); return R._engine.create[apply](R, first.splice(0, 3 + R.is(first[0], nu))).add(first);
} } else {
var args = Array.prototype.slice.call(arguments, 0); var args = Array.prototype.slice.call(arguments, 0);
if (R.is(args[args.length - 1], "function")) { if (R.is(args[args.length - 1], "function")) {
var f = args.pop(); var f = args.pop();
return loaded ? f.call(R._engine.create[apply](R, args)) : eve.on("raphael.DOMload", function () { return loaded ? f.call(R._engine.create[apply](R, args)) : eve.on("raphael.DOMload", function () {
f.call(R._engine.create[apply](R, args)); f.call(R._engine.create[apply](R, args));
}); });
} } else {
return R._engine.create[apply](R, arguments); return R._engine.create[apply](R, arguments);
}
}
} }
R.version = "2.1.4"; R.version = "2.1.4";
R.eve = eve; R.eve = eve;
@ -535,7 +521,7 @@
appendChild = "appendChild", appendChild = "appendChild",
apply = "apply", apply = "apply",
concat = "concat", concat = "concat",
supportsTouch = ("ontouchstart" in g.win) || g.win.DocumentTouch && g.doc instanceof DocumentTouch, // taken from Modernizr touch test supportsTouch = ('ontouchstart' in g.win) || g.win.DocumentTouch && g.doc instanceof DocumentTouch, //taken from Modernizr touch test
E = "", E = "",
S = " ", S = " ",
Str = String, Str = String,
@ -563,7 +549,7 @@
push = "push", push = "push",
ISURL = R._ISURL = /^url\(['"]?(.+?)['"]?\)$/i, ISURL = R._ISURL = /^url\(['"]?(.+?)['"]?\)$/i,
colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i, colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
isnan = {NaN: 1, Infinity: 1, "-Infinity": 1}, isnan = {"NaN": 1, "Infinity": 1, "-Infinity": 1},
bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/, bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
round = math.round, round = math.round,
setAttribute = "setAttribute", setAttribute = "setAttribute",
@ -580,8 +566,8 @@
cy: 0, cy: 0,
fill: "#fff", fill: "#fff",
"fill-opacity": 1, "fill-opacity": 1,
font: "10px \"Arial\"", font: '10px "Arial"',
"font-family": "\"Arial\"", "font-family": '"Arial"',
"font-size": "10", "font-size": "10",
"font-style": "normal", "font-style": "normal",
"font-weight": 400, "font-weight": 400,
@ -731,10 +717,10 @@
if (R.type == "VML") { if (R.type == "VML") {
var d = g.doc.createElement("div"), var d = g.doc.createElement("div"),
b; b;
d.innerHTML = "<v:shape adj=\"1\"/>"; d.innerHTML = '<v:shape adj="1"/>';
b = d.firstChild; b = d.firstChild;
b.style.behavior = "url(#default#VML)"; b.style.behavior = "url(#default#VML)";
if (!(b && typeof b.adj === "object")) { if (!(b && typeof b.adj == "object")) {
return (R.type = E); return (R.type = E);
} }
d = null; d = null;
@ -801,22 +787,20 @@
return o instanceof Array; return o instanceof Array;
} }
return (type == "null" && o === null) || return (type == "null" && o === null) ||
(type === typeof o && o !== null) || (type == typeof o && o !== null) ||
(type == "object" && o === Object(o)) || (type == "object" && o === Object(o)) ||
(type == "array" && Array.isArray && Array.isArray(o)) || (type == "array" && Array.isArray && Array.isArray(o)) ||
objectToString.call(o).slice(8, -1).toLowerCase() == type; objectToString.call(o).slice(8, -1).toLowerCase() == type;
}; };
function clone(obj) { function clone(obj) {
if (typeof obj === "function" || Object(obj) !== obj) { if (typeof obj == "function" || Object(obj) !== obj) {
return obj; return obj;
} }
var res = new obj.constructor; var res = new obj.constructor;
for (var key in obj) { for (var key in obj) if (obj[has](key)) {
if (obj[has](key)) {
res[key] = clone(obj[key]); res[key] = clone(obj[key]);
} }
}
return res; return res;
} }
@ -842,9 +826,9 @@
return 0; return 0;
} }
return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360; return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
} } else {
return R.angle(x1, y1, x3, y3) - R.angle(x2, y2, x3, y3); return R.angle(x1, y1, x3, y3) - R.angle(x2, y2, x3, y3);
}
}; };
/*\ /*\
* Raphael.rad * Raphael.rad
@ -885,11 +869,9 @@
tolerance = R.is(tolerance, "finite") ? tolerance : 10; tolerance = R.is(tolerance, "finite") ? tolerance : 10;
if (R.is(values, array)) { if (R.is(values, array)) {
var i = values.length; var i = values.length;
while (i--) { while (i--) if (abs(values[i] - value) <= tolerance) {
if (abs(values[i] - value) <= tolerance) {
return values[i]; return values[i];
} }
}
} else { } else {
values = +values; values = +values;
var rem = value % values; var rem = value % values;
@ -1221,12 +1203,10 @@
return this.join(",").replace(p2s, "$1"); return this.join(",").replace(p2s, "$1");
}; };
function repush(array, item) { function repush(array, item) {
for (var i = 0, ii = array.length; i < ii; i++) { for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
if (array[i] === item) {
return array.push(array.splice(i, 1)[0]); return array.push(array.splice(i, 1)[0]);
} }
} }
}
function cacher(f, scope, postprocessor) { function cacher(f, scope, postprocessor) {
function newf() { function newf() {
var arg = Array.prototype.slice.call(arguments, 0), var arg = Array.prototype.slice.call(arguments, 0),
@ -1512,14 +1492,12 @@
} }
if (name == "r") { if (name == "r") {
data.push([b][concat](params)); data.push([b][concat](params));
} else { } else while (params.length >= paramCounts[name]) {
while (params.length >= paramCounts[name]) {
data.push([b][concat](params.splice(0, paramCounts[name]))); data.push([b][concat](params.splice(0, paramCounts[name])));
if (!paramCounts[name]) { if (!paramCounts[name]) {
break; break;
} }
} }
}
}); });
} }
data.toString = R._path2string; data.toString = R._path2string;
@ -1570,12 +1548,10 @@
}; };
} }
setTimeout(function () { setTimeout(function () {
for (var key in p) { for (var key in p) if (p[has](key) && key != ps) {
if (p[has](key) && key != ps) {
p[key].sleep--; p[key].sleep--;
!p[key].sleep && delete p[key]; !p[key].sleep && delete p[key];
} }
}
}); });
return p[ps]; return p[ps];
}; };
@ -2319,14 +2295,14 @@
m2[1] = 2 * m1[1] - m2[1]; m2[1] = 2 * m1[1] - m2[1];
if (recursive) { if (recursive) {
return [m2, m3, m4][concat](res); return [m2, m3, m4][concat](res);
} } else {
res = [m2, m3, m4][concat](res).join()[split](","); res = [m2, m3, m4][concat](res).join()[split](",");
var newres = []; var newres = [];
for (var i = 0, ii = res.length; i < ii; i++) { for (var i = 0, ii = res.length; i < ii; i++) {
newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
} }
return newres; return newres;
}
}, },
findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { findDotAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
var t1 = 1 - t; var t1 = 1 - t;
@ -2405,7 +2381,8 @@
if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S. if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
nx = d.x * 2 - d.bx; // And reflect the previous nx = d.x * 2 - d.bx; // And reflect the previous
ny = d.y * 2 - d.by; // command's control point relative to the current point. ny = d.y * 2 - d.by; // command's control point relative to the current point.
} else { // or some else or nothing }
else { // or some else or nothing
nx = d.x; nx = d.x;
ny = d.y; ny = d.y;
} }
@ -2415,7 +2392,8 @@
if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T. if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
d.qx = d.x * 2 - d.qx; // And make a reflection similar d.qx = d.x * 2 - d.qx; // And make a reflection similar
d.qy = d.y * 2 - d.qy; // to case "S". d.qy = d.y * 2 - d.qy; // to case "S".
} else { // or something else or nothing }
else { // or something else or nothing
d.qx = d.x; d.qx = d.x;
d.qy = d.y; d.qy = d.y;
} }
@ -2486,7 +2464,8 @@
if (p2) { // the same procedures is done to p2 if (p2) { // the same procedures is done to p2
p2[i] && (pfirst = p2[i][0]); p2[i] && (pfirst = p2[i][0]);
if (pfirst != "C") { if (pfirst != "C")
{
pcoms2[i] = pfirst; pcoms2[i] = pfirst;
i && (pcom = pcoms2[i-1]); i && (pcom = pcoms2[i-1]);
} }
@ -2740,16 +2719,16 @@
case "m": return [l, 1, 0, 0, 1, 0, 0]; case "m": return [l, 1, 0, 0, 1, 0, 0];
case "r": if (item.length == 4) { case "r": if (item.length == 4) {
return [l, 0, item[2], item[3]]; return [l, 0, item[2], item[3]];
} } else {
return [l, 0]; return [l, 0];
}
case "s": if (item.length == 5) { case "s": if (item.length == 5) {
return [l, 1, 1, item[3], item[4]]; return [l, 1, 1, item[3], item[4]];
} else if (item.length == 3) { } else if (item.length == 3) {
return [l, 1, 1]; return [l, 1, 1];
} } else {
return [l, 1]; return [l, 1];
}
} }
}, },
equaliseTransform = R._equaliseTransform = function (t1, t2) { equaliseTransform = R._equaliseTransform = function (t1, t2) {
@ -2795,13 +2774,13 @@
width: container.style.pixelWidth || container.offsetWidth, width: container.style.pixelWidth || container.offsetWidth,
height: container.style.pixelHeight || container.offsetHeight height: container.style.pixelHeight || container.offsetHeight
}; };
} } else {
return { return {
container: container, container: container,
width: y, width: y,
height: w height: w
}; };
}
} }
return { return {
container: 1, container: 1,
@ -3099,9 +3078,9 @@
return (s.dx || s.dy ? "t" + [s.dx, s.dy] : E) + return (s.dx || s.dy ? "t" + [s.dx, s.dy] : E) +
(s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) + (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
(s.rotate ? "r" + [s.rotate, 0, 0] : E); (s.rotate ? "r" + [s.rotate, 0, 0] : E);
} } else {
return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]; return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
}
}; };
})(Matrix.prototype); })(Matrix.prototype);
@ -3158,7 +3137,8 @@
return function () { return function () {
obj.removeEventListener(type, f, false); obj.removeEventListener(type, f, false);
if (supportsTouch && touchMap[type]) {obj.removeEventListener(touchMap[type], _f, false);} if (supportsTouch && touchMap[type])
obj.removeEventListener(touchMap[type], _f, false);
return true; return true;
}; };
@ -3515,11 +3495,9 @@
} }
if (arguments.length == 1) { if (arguments.length == 1) {
if (R.is(key, "object")) { if (R.is(key, "object")) {
for (var i in key) { for (var i in key) if (key[has](i)) {
if (key[has](i)) {
this.data(i, key[i]); this.data(i, key[i]);
} }
}
return this; return this;
} }
eve("raphael.data.get." + this.id, this, data[key], key); eve("raphael.data.get." + this.id, this, data[key], key);
@ -3674,13 +3652,11 @@
\*/ \*/
elproto.undrag = function () { elproto.undrag = function () {
var i = draggable.length; var i = draggable.length;
while (i--) { while (i--) if (draggable[i].el == this) {
if (draggable[i].el == this) {
this.unmousedown(draggable[i].start); this.unmousedown(draggable[i].start);
draggable.splice(i, 1); draggable.splice(i, 1);
eve.unbind("raphael.drag.*." + this.id); eve.unbind("raphael.drag.*." + this.id);
} }
}
!draggable.length && R.unmousemove(dragMove).unmouseup(dragUp); !draggable.length && R.unmousemove(dragMove).unmouseup(dragUp);
drag = []; drag = [];
}; };
@ -4121,8 +4097,8 @@
\*/ \*/
elproto.isPointInside = function (x, y) { elproto.isPointInside = function (x, y) {
var rp = this.realPath = getPath[this.type](this); var rp = this.realPath = getPath[this.type](this);
if (this.attr("transform") && this.attr("transform").length) { if (this.attr('transform') && this.attr('transform').length) {
rp = R.transformPath(rp, this.attr("transform")); rp = R.transformPath(rp, this.attr('transform'));
} }
return R.isPointInsidePath(rp, x, y); return R.isPointInsidePath(rp, x, y);
}; };
@ -4240,9 +4216,9 @@
getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) { getPointAtSegmentLength = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
if (length == null) { if (length == null) {
return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y); return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
} } else {
return R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length)); return R.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
}
}, },
getLengthFactory = function (istotal, subpath) { getLengthFactory = function (istotal, subpath) {
return function (path, length, onlystart) { return function (path, length, onlystart) {
@ -4551,8 +4527,7 @@
} }
if (time < ms) { if (time < ms) {
var pos = easing(time / ms); var pos = easing(time / ms);
for (var attr in from) { for (var attr in from) if (from[has](attr)) {
if (from[has](attr)) {
switch (availableAnimAttrs[attr]) { switch (availableAnimAttrs[attr]) {
case nu: case nu:
now = +from[attr] + pos * ms * diff[attr]; now = +from[attr] + pos * ms * diff[attr];
@ -4612,7 +4587,6 @@
} }
set[attr] = now; set[attr] = now;
} }
}
that.attr(set); that.attr(set);
(function (id, that, anim) { (function (id, that, anim) {
setTimeout(function () { setTimeout(function () {
@ -4630,11 +4604,9 @@
that.attr(to); that.attr(to);
animationElements.splice(l--, 1); animationElements.splice(l--, 1);
if (e.repeat > 1 && !e.next) { if (e.repeat > 1 && !e.next) {
for (key in to) { for (key in to) if (to[has](key)) {
if (to[has](key)) {
init[key] = e.totalOrigin[key]; init[key] = e.totalOrigin[key];
} }
}
e.el.attr(init); e.el.attr(init);
runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1); runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
} }
@ -4753,12 +4725,10 @@
this.ms = ms; this.ms = ms;
this.times = 1; this.times = 1;
if (anim) { if (anim) {
for (var attr in anim) { for (var attr in anim) if (anim[has](attr)) {
if (anim[has](attr)) {
newAnim[toFloat(attr)] = anim[attr]; newAnim[toFloat(attr)] = anim[attr];
percents.push(toFloat(attr)); percents.push(toFloat(attr));
} }
}
percents.sort(sortByNumber); percents.sort(sortByNumber);
} }
this.anim = newAnim; this.anim = newAnim;
@ -4850,8 +4820,7 @@
return; return;
} }
if (!isInAnim) { if (!isInAnim) {
for (var attr in params) { for (var attr in params) if (params[has](attr)) {
if (params[has](attr)) {
if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) { if (availableAnimAttrs[has](attr) || element.paper.customAttributes[has](attr)) {
from[attr] = element.attr(attr); from[attr] = element.attr(attr);
(from[attr] == null) && (from[attr] = availableAttrs[attr]); (from[attr] == null) && (from[attr] = availableAttrs[attr]);
@ -4958,7 +4927,6 @@
} }
} }
} }
}
var easing = params.easing, var easing = params.easing,
easyeasy = R.easing_formulas[easing]; easyeasy = R.easing_formulas[easing];
if (!easyeasy) { if (!easyeasy) {
@ -5041,12 +5009,10 @@
var p = {}, var p = {},
json, json,
attr; attr;
for (attr in params) { for (attr in params) if (params[has](attr) && toFloat(attr) != attr && toFloat(attr) + "%" != attr) {
if (params[has](attr) && toFloat(attr) != attr && toFloat(attr) + "%" != attr) {
json = true; json = true;
p[attr] = params[attr]; p[attr] = params[attr];
} }
}
if (!json) { if (!json) {
// if percent-like syntax is used and end-of-all animation callback used // if percent-like syntax is used and end-of-all animation callback used
if(callback){ if(callback){
@ -5058,16 +5024,16 @@
lastKey = percent; lastKey = percent;
} }
} }
lastKey += "%"; lastKey += '%';
// if already defined callback in the last keyframe, skip // if already defined callback in the last keyframe, skip
!params[lastKey].callback && (params[lastKey].callback = callback); !params[lastKey].callback && (params[lastKey].callback = callback);
} }
return new Animation(params, ms); return new Animation(params, ms);
} } else {
easing && (p.easing = easing); easing && (p.easing = easing);
callback && (p.callback = callback); callback && (p.callback = callback);
return new Animation({100: p}, ms); return new Animation({100: p}, ms);
}
}; };
/*\ /*\
* Element.animate * Element.animate
@ -5147,7 +5113,7 @@
if (value != null) { if (value != null) {
runAnimation(anim, this, -1, mmin(value, 1)); runAnimation(anim, this, -1, mmin(value, 1));
return this; return this;
} } else {
len = animationElements.length; len = animationElements.length;
for (; i < len; i++) { for (; i < len; i++) {
e = animationElements[i]; e = animationElements[i];
@ -5165,7 +5131,7 @@
return 0; return 0;
} }
return out; return out;
}
}; };
/*\ /*\
* Element.pause * Element.pause
@ -5180,13 +5146,11 @@
= (object) original element = (object) original element
\*/ \*/
elproto.pause = function (anim) { elproto.pause = function (anim) {
for (var i = 0; i < animationElements.length; i++) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (eve("raphael.anim.pause." + this.id, this, animationElements[i].anim) !== false) { if (eve("raphael.anim.pause." + this.id, this, animationElements[i].anim) !== false) {
animationElements[i].paused = true; animationElements[i].paused = true;
} }
} }
}
return this; return this;
}; };
/*\ /*\
@ -5202,15 +5166,13 @@
= (object) original element = (object) original element
\*/ \*/
elproto.resume = function (anim) { elproto.resume = function (anim) {
for (var i = 0; i < animationElements.length; i++) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
var e = animationElements[i]; var e = animationElements[i];
if (eve("raphael.anim.resume." + this.id, this, e.anim) !== false) { if (eve("raphael.anim.resume." + this.id, this, e.anim) !== false) {
delete e.paused; delete e.paused;
this.status(e.anim, e.status); this.status(e.anim, e.status);
} }
} }
}
return this; return this;
}; };
/*\ /*\
@ -5226,22 +5188,18 @@
= (object) original element = (object) original element
\*/ \*/
elproto.stop = function (anim) { elproto.stop = function (anim) {
for (var i = 0; i < animationElements.length; i++) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (eve("raphael.anim.stop." + this.id, this, animationElements[i].anim) !== false) { if (eve("raphael.anim.stop." + this.id, this, animationElements[i].anim) !== false) {
animationElements.splice(i--, 1); animationElements.splice(i--, 1);
} }
} }
}
return this; return this;
}; };
function stopAnimation(paper) { function stopAnimation(paper) {
for (var i = 0; i < animationElements.length; i++) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.paper == paper) {
if (animationElements[i].el.paper == paper) {
animationElements.splice(i--, 1); animationElements.splice(i--, 1);
} }
} }
}
eve.on("raphael.remove", stopAnimation); eve.on("raphael.remove", stopAnimation);
eve.on("raphael.clear", stopAnimation); eve.on("raphael.clear", stopAnimation);
elproto.toString = function () { elproto.toString = function () {
@ -5316,8 +5274,7 @@
} }
return this; return this;
}; };
for (var method in elproto) { for (var method in elproto) if (elproto[has](method)) {
if (elproto[has](method)) {
setproto[method] = (function (methodname) { setproto[method] = (function (methodname) {
return function () { return function () {
var arg = arguments; var arg = arguments;
@ -5327,7 +5284,6 @@
}; };
})(method); })(method);
} }
}
setproto.attr = function (name, value) { setproto.attr = function (name, value) {
if (name && R.is(name, array) && R.is(name[0], "object")) { if (name && R.is(name, array) && R.is(name[0], "object")) {
for (var j = 0, jj = name.length; j < jj; j++) { for (var j = 0, jj = name.length; j < jj; j++) {
@ -5402,12 +5358,10 @@
= (boolean) `true` if object was found & removed from the set = (boolean) `true` if object was found & removed from the set
\*/ \*/
setproto.exclude = function (el) { setproto.exclude = function (el) {
for (var i = 0, ii = this.length; i < ii; i++) { for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) {
if (this[i] == el) {
this.splice(i, 1); this.splice(i, 1);
return true; return true;
} }
}
}; };
setproto.animate = function (params, ms, easing, callback) { setproto.animate = function (params, ms, easing, callback) {
(R.is(easing, "function") || !easing) && (callback = easing || null); (R.is(easing, "function") || !easing) && (callback = easing || null);
@ -5443,15 +5397,13 @@
y = [], y = [],
x2 = [], x2 = [],
y2 = []; y2 = [];
for (var i = this.items.length; i--;) { for (var i = this.items.length; i--;) if (!this.items[i].removed) {
if (!this.items[i].removed) {
var box = this.items[i].getBBox(); var box = this.items[i].getBBox();
x.push(box.x); x.push(box.x);
y.push(box.y); y.push(box.y);
x2.push(box.x + box.width); x2.push(box.x + box.width);
y2.push(box.y + box.height); y2.push(box.y + box.height);
} }
}
x = mmin[apply](0, x); x = mmin[apply](0, x);
y = mmin[apply](0, y); y = mmin[apply](0, y);
x2 = mmax[apply](0, x2); x2 = mmax[apply](0, x2);
@ -5539,11 +5491,9 @@
glyphs: {} glyphs: {}
}, },
family = font.face["font-family"]; family = font.face["font-family"];
for (var prop in font.face) { for (var prop in font.face) if (font.face[has](prop)) {
if (font.face[has](prop)) {
fontcopy.face[prop] = font.face[prop]; fontcopy.face[prop] = font.face[prop];
} }
}
if (this.fonts[family]) { if (this.fonts[family]) {
this.fonts[family].push(fontcopy); this.fonts[family].push(fontcopy);
} else { } else {
@ -5551,8 +5501,7 @@
} }
if (!font.svg) { if (!font.svg) {
fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10); fontcopy.face["units-per-em"] = toInt(font.face["units-per-em"], 10);
for (var glyph in font.glyphs) { for (var glyph in font.glyphs) if (font.glyphs[has](glyph)) {
if (font.glyphs[has](glyph)) {
var path = font.glyphs[glyph]; var path = font.glyphs[glyph];
fontcopy.glyphs[glyph] = { fontcopy.glyphs[glyph] = {
w: path.w, w: path.w,
@ -5562,15 +5511,12 @@
}) + "z" }) + "z"
}; };
if (path.k) { if (path.k) {
for (var k in path.k) { for (var k in path.k) if (path[has](k)) {
if (path[has](k)) {
fontcopy.glyphs[glyph].k[k] = path.k[k]; fontcopy.glyphs[glyph].k[k] = path.k[k];
} }
} }
} }
} }
}
}
return font; return font;
}; };
/*\ /*\
@ -5599,15 +5545,13 @@
var font = R.fonts[family]; var font = R.fonts[family];
if (!font) { if (!font) {
var name = new RegExp("(^|\\s)" + family.replace(/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i"); var name = new RegExp("(^|\\s)" + family.replace(/[^\w\d\s+!~.:_-]/g, E) + "(\\s|$)", "i");
for (var fontName in R.fonts) { for (var fontName in R.fonts) if (R.fonts[has](fontName)) {
if (R.fonts[has](fontName)) {
if (name.test(fontName)) { if (name.test(fontName)) {
font = R.fonts[fontName]; font = R.fonts[fontName];
break; break;
} }
} }
} }
}
var thefont; var thefont;
if (font) { if (font) {
for (var i = 0, ii = font.length; i < ii; i++) { for (var i = 0, ii = font.length; i < ii; i++) {
@ -5782,7 +5726,7 @@
if (name in res) { if (name in res) {
res = res[name]; res = res[name];
} }
typeof res === "function" && isFunc && (res = res()); typeof res == "function" && isFunc && (res = res());
} }
}); });
res = (res == null || res == obj ? all : res) + ""; res = (res == null || res == obj ? all : res) + "";
@ -5907,18 +5851,16 @@
}; };
var $ = function (el, attr) { var $ = function (el, attr) {
if (attr) { if (attr) {
if (typeof el === "string") { if (typeof el == "string") {
el = $(el); el = $(el);
} }
for (var key in attr) { for (var key in attr) if (attr[has](key)) {
if (attr[has](key)) {
if (key.substring(0, 6) == "xlink:") { if (key.substring(0, 6) == "xlink:") {
el.setAttributeNS(xlink, key.substring(6), Str(attr[key])); el.setAttributeNS(xlink, key.substring(6), Str(attr[key]));
} else { } else {
el.setAttribute(key, Str(attr[key])); el.setAttribute(key, Str(attr[key]));
} }
} }
}
} else { } else {
el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el); el = R._g.doc.createElementNS("http://www.w3.org/2000/svg", el);
el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)"); el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
@ -6148,13 +6090,11 @@
delete o._.arrows[se + "Type"]; delete o._.arrows[se + "Type"];
delete o._.arrows[se + "String"]; delete o._.arrows[se + "String"];
} }
for (attr in markerCounter) { for (attr in markerCounter) if (markerCounter[has](attr) && !markerCounter[attr]) {
if (markerCounter[has](attr) && !markerCounter[attr]) {
var item = R._g.doc.getElementById(attr); var item = R._g.doc.getElementById(attr);
item && item.parentNode.removeChild(item); item && item.parentNode.removeChild(item);
} }
} }
}
}, },
dasharray = { dasharray = {
"-": [3, 1], "-": [3, 1],
@ -6179,7 +6119,8 @@
dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt; dashes[i] = value[i] * width + ((i % 2) ? 1 : -1) * butt;
} }
$(o.node, {"stroke-dasharray": dashes.join(",")}); $(o.node, {"stroke-dasharray": dashes.join(",")});
} else { }
else {
$(o.node, {"stroke-dasharray": "none"}); $(o.node, {"stroke-dasharray": "none"});
} }
}, },
@ -6465,14 +6406,12 @@
} }
} else { } else {
tspans = node.getElementsByTagName("tspan"); tspans = node.getElementsByTagName("tspan");
for (i = 0, ii = tspans.length; i < ii; i++) { for (i = 0, ii = tspans.length; i < ii; i++) if (i) {
if (i) {
$(tspans[i], {dy: fontSize * leading, x: a.x}); $(tspans[i], {dy: fontSize * leading, x: a.x});
} else { } else {
$(tspans[0], {dy: 0}); $(tspans[0], {dy: 0});
} }
} }
}
$(node, {x: a.x, y: a.y}); $(node, {x: a.x, y: a.y});
el._.dirty = 1; el._.dirty = 1;
var bb = el._getBBox(), var bb = el._getBBox(),
@ -6482,9 +6421,9 @@
getRealNode = function (node) { getRealNode = function (node) {
if (node.parentNode && node.parentNode.tagName.toLowerCase() === "a") { if (node.parentNode && node.parentNode.tagName.toLowerCase() === "a") {
return node.parentNode; return node.parentNode;
} } else {
return node; return node;
}
}, },
Element = function (node, svg) { Element = function (node, svg) {
var X = 0, var X = 0,
@ -6781,7 +6720,7 @@
this.removeData(); this.removeData();
for (var i in this) { for (var i in this) {
this[i] = typeof this[i] === "function" ? R._removedFactory(i) : null; this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
} }
this.removed = true; this.removed = true;
}; };
@ -6813,7 +6752,7 @@
y: this.node.clientTop, y: this.node.clientTop,
width: this.node.clientWidth, width: this.node.clientWidth,
height: this.node.clientHeight height: this.node.clientHeight
}; }
} finally { } finally {
bbox = bbox || {}; bbox = bbox || {};
if(canvasHidden){ if(canvasHidden){
@ -6910,11 +6849,9 @@
} }
if (name == null) { if (name == null) {
var res = {}; var res = {};
for (var a in this.attrs) { for (var a in this.attrs) if (this.attrs[has](a)) {
if (this.attrs[has](a)) {
res[a] = this.attrs[a]; res[a] = this.attrs[a];
} }
}
res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
res.transform = this._.transform; res.transform = this._.transform;
return res; return res;
@ -6956,17 +6893,13 @@
for (var key in params) { for (var key in params) {
eve("raphael.attr." + key + "." + this.id, this, params[key]); eve("raphael.attr." + key + "." + this.id, this, params[key]);
} }
for (key in this.paper.customAttributes) { for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
this.attrs[key] = params[key]; this.attrs[key] = params[key];
for (var subkey in par) { for (var subkey in par) if (par[has](subkey)) {
if (par[has](subkey)) {
params[subkey] = par[subkey]; params[subkey] = par[subkey];
} }
} }
}
}
setFillAndStroke(this, params); setFillAndStroke(this, params);
return this; return this;
}; };
@ -7270,12 +7203,11 @@
eve("raphael.remove", this); eve("raphael.remove", this);
this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas); this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
for (var i in this) { for (var i in this) {
this[i] = typeof this[i] === "function" ? R._removedFactory(i) : null; this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
} }
}; };
var setproto = R.st; var setproto = R.st;
for (var method in elproto) { for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) {
if (elproto[has](method) && !setproto[has](method)) {
setproto[method] = (function (methodname) { setproto[method] = (function (methodname) {
return function () { return function () {
var arg = arguments; var arg = arguments;
@ -7285,7 +7217,6 @@
}; };
})(method); })(method);
} }
}
})); }));
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\
@ -7461,11 +7392,9 @@
res = o; res = o;
for (var par in params) { for (var par in params) if (params[has](par)) {
if (params[has](par)) {
a[par] = params[par]; a[par] = params[par];
} }
}
if (newpath) { if (newpath) {
a.path = R._getPath[o.type](o); a.path = R._getPath[o.type](o);
o._.dirty = 1; o._.dirty = 1;
@ -7519,7 +7448,7 @@
if (o.textpath) { if (o.textpath) {
var textpathStyle = o.textpath.style; var textpathStyle = o.textpath.style;
params.font && (textpathStyle.font = params.font); params.font && (textpathStyle.font = params.font);
params["font-family"] && (textpathStyle.fontFamily = "\"" + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + "\""); params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"');
params["font-size"] && (textpathStyle.fontSize = params["font-size"]); params["font-size"] && (textpathStyle.fontSize = params["font-size"]);
params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]); params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]);
params["font-style"] && (textpathStyle.fontStyle = params["font-style"]); params["font-style"] && (textpathStyle.fontStyle = params["font-style"]);
@ -7652,12 +7581,10 @@
("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1)); ("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1));
var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"]; var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
for (var d = 0, dd = dirtyattrs.length; d < dd; d++) { for (var d = 0, dd = dirtyattrs.length; d < dd; d++) if (dirtyattrs[d] in params) {
if (dirtyattrs[d] in params) {
res._.dirty = 1; res._.dirty = 1;
break; break;
} }
}
// text-anchor emulation // text-anchor emulation
switch (a["text-anchor"]) { switch (a["text-anchor"]) {
@ -7888,7 +7815,8 @@
elproto.auxGetBBox = R.el.getBBox; elproto.auxGetBBox = R.el.getBBox;
elproto.getBBox = function(){ elproto.getBBox = function(){
var b = this.auxGetBBox(); var b = this.auxGetBBox();
if (this.paper && this.paper._viewBoxShift) { if (this.paper && this.paper._viewBoxShift)
{
var c = {}; var c = {};
var z = 1/this.paper._viewBoxShift.scale; var z = 1/this.paper._viewBoxShift.scale;
c.x = b.x - this.paper._viewBoxShift.dx; c.x = b.x - this.paper._viewBoxShift.dx;
@ -7924,7 +7852,7 @@
this.node.parentNode.removeChild(this.node); this.node.parentNode.removeChild(this.node);
this.shape && this.shape.parentNode.removeChild(this.shape); this.shape && this.shape.parentNode.removeChild(this.shape);
for (var i in this) { for (var i in this) {
this[i] = typeof this[i] === "function" ? R._removedFactory(i) : null; this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
} }
this.removed = true; this.removed = true;
}; };
@ -7934,11 +7862,9 @@
} }
if (name == null) { if (name == null) {
var res = {}; var res = {};
for (var a in this.attrs) { for (var a in this.attrs) if (this.attrs[has](a)) {
if (this.attrs[has](a)) {
res[a] = this.attrs[a]; res[a] = this.attrs[a];
} }
}
res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient; res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
res.transform = this._.transform; res.transform = this._.transform;
return res; return res;
@ -7978,17 +7904,13 @@
eve("raphael.attr." + key + "." + this.id, this, params[key]); eve("raphael.attr." + key + "." + this.id, this, params[key]);
} }
if (params) { if (params) {
for (key in this.paper.customAttributes) { for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key])); var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
this.attrs[key] = params[key]; this.attrs[key] = params[key];
for (var subkey in par) { for (var subkey in par) if (par[has](subkey)) {
if (par[has](subkey)) {
params[subkey] = par[subkey]; params[subkey] = par[subkey];
} }
} }
}
}
// this.paper.canvas.style.display = "none"; // this.paper.canvas.style.display = "none";
if (params.text && this.type == "text") { if (params.text && this.type == "text") {
this.textpath.string = params.text; this.textpath.string = params.text;
@ -8236,11 +8158,11 @@
try { try {
!doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"); !doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
createNode = function (tagName) { createNode = function (tagName) {
return doc.createElement("<rvml:" + tagName + " class=\"rvml\">"); return doc.createElement('<rvml:' + tagName + ' class="rvml">');
}; };
} catch (e) { } catch (e) {
createNode = function (tagName) { createNode = function (tagName) {
return doc.createElement("<" + tagName + " xmlns=\"urn:schemas-microsoft.com:vml\" class=\"rvml\">"); return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
}; };
} }
}; };
@ -8300,14 +8222,13 @@
R.eve("raphael.remove", this); R.eve("raphael.remove", this);
this.canvas.parentNode.removeChild(this.canvas); this.canvas.parentNode.removeChild(this.canvas);
for (var i in this) { for (var i in this) {
this[i] = typeof this[i] === "function" ? R._removedFactory(i) : null; this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
} }
return true; return true;
}; };
var setproto = R.st; var setproto = R.st;
for (var method in elproto) { for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) {
if (elproto[has](method) && !setproto[has](method)) {
setproto[method] = (function (methodname) { setproto[method] = (function (methodname) {
return function () { return function () {
var arg = arguments; var arg = arguments;
@ -8317,7 +8238,6 @@
}; };
})(method); })(method);
} }
}
})); }));
// ┌────────────────────────────────────────────────────────────────────┐ \\ // ┌────────────────────────────────────────────────────────────────────┐ \\

117
src/base/tree/ztree/jquery.ztree.core-3.5.js

@ -282,7 +282,7 @@
treeEventType: treeEventType, treeEventType: treeEventType,
treeEventCallback: treeEventCallback treeEventCallback: treeEventCallback
}; };
return proxyResult; return proxyResult
}, },
//default init node of core //default init node of core
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) { _initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
@ -292,12 +292,12 @@
n.level = level; n.level = level;
n.tId = setting.treeId + "_" + (++r.zId); n.tId = setting.treeId + "_" + (++r.zId);
n.parentTId = parentNode ? parentNode.tId : null; n.parentTId = parentNode ? parentNode.tId : null;
n.open = (typeof n.open === "string") ? tools.eqs(n.open, "true") : !!n.open; n.open = (typeof n.open == "string") ? tools.eqs(n.open, "true") : !!n.open;
if (n[childKey] && n[childKey].length > 0) { if (n[childKey] && n[childKey].length > 0) {
n.isParent = true; n.isParent = true;
n.zAsync = true; n.zAsync = true;
} else { } else {
n.isParent = (typeof n.isParent === "string") ? tools.eqs(n.isParent, "true") : !!n.isParent; n.isParent = (typeof n.isParent == "string") ? tools.eqs(n.isParent, "true") : !!n.isParent;
n.open = (n.isParent && !setting.async.enable) ? n.open : false; n.open = (n.isParent && !setting.async.enable) ? n.open : false;
n.zAsync = !n.isParent; n.zAsync = !n.isParent;
} }
@ -355,7 +355,7 @@
_init.nodes.push(initNode); _init.nodes.push(initNode);
}, },
addInitProxy: function(initProxy, isFirst) { addInitProxy: function(initProxy, isFirst) {
if (isFirst) { if (!!isFirst) {
_init.proxys.splice(0,0,initProxy); _init.proxys.splice(0,0,initProxy);
} else { } else {
_init.proxys.push(initProxy); _init.proxys.push(initProxy);
@ -477,7 +477,7 @@
result = []; result = [];
value = value.toLowerCase(); value = value.toLowerCase();
for (var i = 0, l = nodes.length; i < l; i++) { for (var i = 0, l = nodes.length; i < l; i++) {
if (typeof nodes[i][key] === "string" && nodes[i][key].toLowerCase().indexOf(value) > -1) { if (typeof nodes[i][key] == "string" && nodes[i][key].toLowerCase().indexOf(value)>-1) {
result.push(nodes[i]); result.push(nodes[i]);
} }
result = result.concat(data.getNodesByParamFuzzy(setting, nodes[i][childKey], key, value)); result = result.concat(data.getNodesByParamFuzzy(setting, nodes[i][childKey], key, value));
@ -584,11 +584,13 @@
if (tools.isArray(nodes)) { if (tools.isArray(nodes)) {
for (var i=0, l=nodes.length; i<l; i++) { for (var i=0, l=nodes.length; i<l; i++) {
r.push(nodes[i]); r.push(nodes[i]);
if (nodes[i][childKey]) {r = r.concat(data.transformToArrayFormat(setting, nodes[i][childKey]));} if (nodes[i][childKey])
r = r.concat(data.transformToArrayFormat(setting, nodes[i][childKey]));
} }
} else { } else {
r.push(nodes); r.push(nodes);
if (nodes[childKey]) {r = r.concat(data.transformToArrayFormat(setting, nodes[childKey]));} if (nodes[childKey])
r = r.concat(data.transformToArrayFormat(setting, nodes[childKey]));
} }
return r; return r;
}, },
@ -607,16 +609,17 @@
} }
for (i=0, l=sNodes.length; i<l; i++) { for (i=0, l=sNodes.length; i<l; i++) {
if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) { if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) {
if (!tmpMap[sNodes[i][parentKey]][childKey]) {tmpMap[sNodes[i][parentKey]][childKey] = [];} if (!tmpMap[sNodes[i][parentKey]][childKey])
tmpMap[sNodes[i][parentKey]][childKey] = [];
tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]); tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]);
} else { } else {
r.push(sNodes[i]); r.push(sNodes[i]);
} }
} }
return r; return r;
} }else {
return [sNodes]; return [sNodes];
}
} }
}, },
//method of event proxy //method of event proxy
@ -638,31 +641,31 @@
o = setting.treeObj; o = setting.treeObj;
if (!setting.view.txtSelectedEnable) { if (!setting.view.txtSelectedEnable) {
// for can't select text // for can't select text
o.bind("selectstart", function (e) { o.bind('selectstart', function(e){
var node; var node
var n = e.originalEvent.srcElement.nodeName.toLowerCase(); var n = e.originalEvent.srcElement.nodeName.toLowerCase();
return (n === "input" || n === "textarea" ); return (n === "input" || n === "textarea" );
}).css({ }).css({
"-moz-user-select":"-moz-none" "-moz-user-select":"-moz-none"
}); });
} }
o.bind("click", eventParam, event.proxy); o.bind('click', eventParam, event.proxy);
o.bind("dblclick", eventParam, event.proxy); o.bind('dblclick', eventParam, event.proxy);
o.bind("mouseover", eventParam, event.proxy); o.bind('mouseover', eventParam, event.proxy);
o.bind("mouseout", eventParam, event.proxy); o.bind('mouseout', eventParam, event.proxy);
o.bind("mousedown", eventParam, event.proxy); o.bind('mousedown', eventParam, event.proxy);
o.bind("mouseup", eventParam, event.proxy); o.bind('mouseup', eventParam, event.proxy);
o.bind("contextmenu", eventParam, event.proxy); o.bind('contextmenu', eventParam, event.proxy);
}, },
unbindTree: function(setting) { unbindTree: function(setting) {
var o = setting.treeObj; var o = setting.treeObj;
o.unbind("click", event.proxy) o.unbind('click', event.proxy)
.unbind("dblclick", event.proxy) .unbind('dblclick', event.proxy)
.unbind("mouseover", event.proxy) .unbind('mouseover', event.proxy)
.unbind("mouseout", event.proxy) .unbind('mouseout', event.proxy)
.unbind("mousedown", event.proxy) .unbind('mousedown', event.proxy)
.unbind("mouseup", event.proxy) .unbind('mouseup', event.proxy)
.unbind("contextmenu", event.proxy); .unbind('contextmenu', event.proxy);
}, },
doProxy: function(e) { doProxy: function(e) {
var results = []; var results = [];
@ -747,13 +750,13 @@
if (tools.apply(setting.callback.beforeRightClick, [setting.treeId, node], true)) { if (tools.apply(setting.callback.beforeRightClick, [setting.treeId, node], true)) {
tools.apply(setting.callback.onRightClick, [event, setting.treeId, node]); tools.apply(setting.callback.onRightClick, [event, setting.treeId, node]);
} }
return (typeof setting.callback.onRightClick) !== "function"; return (typeof setting.callback.onRightClick) != "function";
} }
}, },
//method of tools for zTree //method of tools for zTree
tools = { tools = {
apply: function(fun, param, defaultValue) { apply: function(fun, param, defaultValue) {
if ((typeof fun) === "function") { if ((typeof fun) == "function") {
return fun.apply(zt, param?param:[]); return fun.apply(zt, param?param:[]);
} }
return defaultValue; return defaultValue;
@ -777,15 +780,15 @@
return Object.prototype.toString.apply(arr) === "[object Array]"; return Object.prototype.toString.apply(arr) === "[object Array]";
}, },
$: function(node, exp, setting) { $: function(node, exp, setting) {
if (!!exp && typeof exp !== "string") { if (!!exp && typeof exp != "string") {
setting = exp; setting = exp;
exp = ""; exp = "";
} }
if (typeof node === "string") { if (typeof node == "string") {
return $(node, setting ? setting.treeObj.get(0).ownerDocument : null); return $(node, setting ? setting.treeObj.get(0).ownerDocument : null);
} } else {
return $("#" + node.tId + exp, setting ? setting.treeObj : null); return $("#" + node.tId + exp, setting ? setting.treeObj : null);
}
}, },
getMDom: function (setting, curDom, targetExpr) { getMDom: function (setting, curDom, targetExpr) {
if (!curDom) return null; if (!curDom) return null;
@ -831,7 +834,7 @@
view.replaceIcoClass(parentNode, target_icoObj, consts.folder.CLOSE); view.replaceIcoClass(parentNode, target_icoObj, consts.folder.CLOSE);
parentNode.open = false; parentNode.open = false;
target_ulObj.css({ target_ulObj.css({
display: "none" "display": "none"
}); });
} }
@ -877,7 +880,7 @@
view.makeDOMNodeNameAfter(html, setting, node); view.makeDOMNodeNameAfter(html, setting, node);
data.getAfterA(setting, node, html); data.getAfterA(setting, node, html);
if (node.isParent && node.open) { if (node.isParent && node.open) {
view.makeUlHtml(setting, node, html, childHtml.join("")); view.makeUlHtml(setting, node, html, childHtml.join(''));
} }
view.makeDOMNodeMainAfter(html, setting, node); view.makeDOMNodeMainAfter(html, setting, node);
data.addCreatedNode(setting, node); data.addCreatedNode(setting, node);
@ -898,8 +901,8 @@
} }
var childKey = setting.data.key.children, var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true); childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join("")); view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join("")); nObj.append(html.join(''));
}, },
asyncNode: function(setting, node, isSilent, callback) { asyncNode: function(setting, node, isSilent, callback) {
var i, l; var i, l;
@ -915,7 +918,7 @@
if (node) { if (node) {
node.isAjaxing = true; node.isAjaxing = true;
var icoObj = $$(node, consts.id.ICON, setting); var icoObj = $$(node, consts.id.ICON, setting);
icoObj.attr({style: "", class: consts.className.BUTTON + " " + consts.className.ICO_LOADING}); icoObj.attr({"style":"", "class":consts.className.BUTTON + " " + consts.className.ICO_LOADING});
} }
var tmpParam = {}; var tmpParam = {};
@ -953,7 +956,7 @@
try { try {
if (!msg || msg.length == 0) { if (!msg || msg.length == 0) {
newNodes = []; newNodes = [];
} else if (typeof msg === "string") { } else if (typeof msg == "string") {
newNodes = eval("(" + msg + ")"); newNodes = eval("(" + msg + ")");
} else { } else {
newNodes = msg; newNodes = msg;
@ -969,7 +972,7 @@
view.setNodeLineIcos(setting, node); view.setNodeLineIcos(setting, node);
if (newNodes && newNodes !== "") { if (newNodes && newNodes !== "") {
newNodes = tools.apply(setting.async.dataFilter, [setting.treeId, node, newNodes], newNodes); newNodes = tools.apply(setting.async.dataFilter, [setting.treeId, node, newNodes], newNodes);
view.addNodes(setting, node, newNodes ? tools.clone(newNodes) : [], !!isSilent); view.addNodes(setting, node, !!newNodes ? tools.clone(newNodes) : [], !!isSilent);
} else { } else {
view.addNodes(setting, node, [], !!isSilent); view.addNodes(setting, node, [], !!isSilent);
} }
@ -1011,7 +1014,7 @@
while (root.createdNodes.length>0) { while (root.createdNodes.length>0) {
var node = root.createdNodes.shift(); var node = root.createdNodes.shift();
tools.apply(setting.view.addDiyDom, [setting.treeId, node]); tools.apply(setting.view.addDiyDom, [setting.treeId, node]);
if (setting.callback.onNodeCreated) { if (!!setting.callback.onNodeCreated) {
setting.treeObj.trigger(consts.event.NODECREATED, [setting.treeId, node]); setting.treeObj.trigger(consts.event.NODECREATED, [setting.treeId, node]);
} }
} }
@ -1025,11 +1028,11 @@
root.createdNodes = []; root.createdNodes = [];
var zTreeHtml = view.appendNodes(setting, level, nodes, parentNode, true, openFlag); var zTreeHtml = view.appendNodes(setting, level, nodes, parentNode, true, openFlag);
if (!parentNode) { if (!parentNode) {
setting.treeObj.append(zTreeHtml.join("")); setting.treeObj.append(zTreeHtml.join(''));
} else { } else {
var ulObj = $$(parentNode, consts.id.UL, setting); var ulObj = $$(parentNode, consts.id.UL, setting);
if (ulObj.get(0)) { if (ulObj.get(0)) {
ulObj.append(zTreeHtml.join("")); ulObj.append(zTreeHtml.join(''));
} }
} }
view.createNodeCallback(setting); view.createNodeCallback(setting);
@ -1113,9 +1116,9 @@
if (!node.parentTId) { if (!node.parentTId) {
view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback); view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback);
return; return;
} } else {
view.expandCollapseNode(setting, node, expandFlag, animateFlag); view.expandCollapseNode(setting, node, expandFlag, animateFlag);
}
if (node.parentTId) { if (node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, animateFlag, callback); view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, animateFlag, callback);
} }
@ -1150,7 +1153,7 @@
}, },
makeDOMNodeIcon: function(html, setting, node) { makeDOMNodeIcon: function(html, setting, node) {
var nameStr = data.getNodeName(setting, node), var nameStr = data.getNodeName(setting, node),
name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
html.push("<span id='", node.tId, consts.id.ICON, html.push("<span id='", node.tId, consts.id.ICON,
"' title='' treeNode", consts.id.ICON," class='", view.makeNodeIcoClass(setting, node), "' title='' treeNode", consts.id.ICON," class='", view.makeNodeIcoClass(setting, node),
"' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN, "' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN,
@ -1176,15 +1179,15 @@
for (var f in fontcss) { for (var f in fontcss) {
fontStyle.push(f, ":", fontcss[f], ";"); fontStyle.push(f, ":", fontcss[f], ";");
} }
html.push("<a id='", node.tId, consts.id.A, "' class='", consts.className.LEVEL, node.level, "' treeNode", consts.id.A, " onclick=\"", (node.click || ""), html.push("<a id='", node.tId, consts.id.A, "' class='", consts.className.LEVEL, node.level,"' treeNode", consts.id.A," onclick=\"", (node.click || ''),
"\" ", ((url != null && url.length > 0) ? "href='" + url + "'" : ""), " target='", view.makeNodeTarget(node), "' style='", fontStyle.join(""), "\" ", ((url != null && url.length > 0) ? "href='" + url + "'" : ""), " target='",view.makeNodeTarget(node),"' style='", fontStyle.join(''),
"'"); "'");
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) {html.push("title='", title.replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), "'");} if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) {html.push("title='", title.replace(/'/g,"&#39;").replace(/</g,'&lt;').replace(/>/g,'&gt;'),"'");}
html.push(">"); html.push(">");
}, },
makeNodeFontCss: function(setting, node) { makeNodeFontCss: function(setting, node) {
var fontCss = tools.apply(setting.view.fontCss, [setting.treeId, node], setting.view.fontCss); var fontCss = tools.apply(setting.view.fontCss, [setting.treeId, node], setting.view.fontCss);
return (fontCss && ((typeof fontCss) !== "function")) ? fontCss : {}; return (fontCss && ((typeof fontCss) != "function")) ? fontCss : {};
}, },
makeNodeIcoClass: function(setting, node) { makeNodeIcoClass: function(setting, node) {
var icoCss = ["ico"]; var icoCss = ["ico"];
@ -1196,7 +1199,7 @@
icoCss.push(consts.folder.DOCU); icoCss.push(consts.folder.DOCU);
} }
} }
return consts.className.BUTTON + " " + icoCss.join("_"); return consts.className.BUTTON + " " + icoCss.join('_');
}, },
makeNodeIcoStyle: function(setting, node) { makeNodeIcoStyle: function(setting, node) {
var icoStyle = []; var icoStyle = [];
@ -1207,7 +1210,7 @@
icoStyle.push("width:0px;height:0px;"); icoStyle.push("width:0px;height:0px;");
} }
} }
return icoStyle.join(""); return icoStyle.join('');
}, },
makeNodeLineClass: function(setting, node) { makeNodeLineClass: function(setting, node) {
var lineClass = []; var lineClass = [];
@ -1229,7 +1232,7 @@
} else { } else {
lineClass.push(consts.folder.DOCU); lineClass.push(consts.folder.DOCU);
} }
return view.makeNodeLineClassEx(node) + lineClass.join("_"); return view.makeNodeLineClassEx(node) + lineClass.join('_');
}, },
makeNodeLineClassEx: function(node) { makeNodeLineClassEx: function(node) {
return consts.className.BUTTON + " " + consts.className.LEVEL + node.level + " " + consts.className.SWITCH + " "; return consts.className.BUTTON + " " + consts.className.LEVEL + node.level + " " + consts.className.SWITCH + " ";
@ -1593,7 +1596,7 @@
}, },
getNodesByFilter: function(filter, isSingle, parentNode, invokeParam) { getNodesByFilter: function(filter, isSingle, parentNode, invokeParam) {
isSingle = !!isSingle; isSingle = !!isSingle;
if (!filter || (typeof filter !== "function")) return (isSingle ? null : []); if (!filter || (typeof filter != "function")) return (isSingle ? null : []);
return data.getNodesByFilter(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), filter, isSingle, invokeParam); return data.getNodesByFilter(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), filter, isSingle, invokeParam);
}, },
getNodeIndex : function(node) { getNodeIndex : function(node) {
@ -1640,9 +1643,9 @@
refresh : function() { refresh : function() {
this.setting.treeObj.empty(); this.setting.treeObj.empty();
var root = data.getRoot(setting), var root = data.getRoot(setting),
nodes = root[setting.data.key.children]; nodes = root[setting.data.key.children]
data.initRoot(setting); data.initRoot(setting);
root[setting.data.key.children] = nodes; root[setting.data.key.children] = nodes
data.initCache(setting); data.initCache(setting);
view.createNodes(setting, 0, root[setting.data.key.children]); view.createNodes(setting, 0, root[setting.data.key.children]);
}, },
@ -1693,13 +1696,13 @@
view.setNodeFontCss(setting, node); view.setNodeFontCss(setting, node);
} }
} }
}; }
root.treeTools = zTreeTools; root.treeTools = zTreeTools;
data.setZTreeTools(setting, zTreeTools); data.setZTreeTools(setting, zTreeTools);
if (root[childKey] && root[childKey].length > 0) { if (root[childKey] && root[childKey].length > 0) {
view.createNodes(setting, 0, root[childKey]); view.createNodes(setting, 0, root[childKey]);
} else if (setting.async.enable && setting.async.url && setting.async.url !== "") { } else if (setting.async.enable && setting.async.url && setting.async.url !== '') {
view.asyncNode(setting); view.asyncNode(setting);
} }
return zTreeTools; return zTreeTools;

34
src/base/tree/ztree/jquery.ztree.excheck-3.5.js

@ -45,8 +45,8 @@
chkDisabledInherit: false, chkDisabledInherit: false,
radioType: _consts.radio.TYPE_LEVEL, radioType: _consts.radio.TYPE_LEVEL,
chkboxType: { chkboxType: {
Y: "ps", "Y": "ps",
N: "ps" "N": "ps"
} }
}, },
data: { data: {
@ -126,20 +126,20 @@
treeEventType: treeEventType, treeEventType: treeEventType,
treeEventCallback: treeEventCallback treeEventCallback: treeEventCallback
}; };
return proxyResult; return proxyResult
}, },
//default init node of excheck //default init node of excheck
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) { _initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return; if (!n) return;
var checkedKey = setting.data.key.checked; var checkedKey = setting.data.key.checked;
if (typeof n[checkedKey] === "string") n[checkedKey] = tools.eqs(n[checkedKey], "true"); if (typeof n[checkedKey] == "string") n[checkedKey] = tools.eqs(n[checkedKey], "true");
n[checkedKey] = !!n[checkedKey]; n[checkedKey] = !!n[checkedKey];
n.checkedOld = n[checkedKey]; n.checkedOld = n[checkedKey];
if (typeof n.nocheck === "string") n.nocheck = tools.eqs(n.nocheck, "true"); if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck); n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
if (typeof n.chkDisabled === "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true"); if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled); n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
if (typeof n.halfCheck === "string") n.halfCheck = tools.eqs(n.halfCheck, "true"); if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
n.halfCheck = !!n.halfCheck; n.halfCheck = !!n.halfCheck;
n.check_Child_State = -1; n.check_Child_State = -1;
n.check_Focus = false; n.check_Focus = false;
@ -183,22 +183,22 @@
this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]); this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
} }
} }
}; }
zTreeTools.checkAllNodes = function(checked) { zTreeTools.checkAllNodes = function(checked) {
view.repairAllChk(this.setting, !!checked); view.repairAllChk(this.setting, !!checked);
}; }
zTreeTools.getCheckedNodes = function(checked) { zTreeTools.getCheckedNodes = function(checked) {
var childKey = this.setting.data.key.children; var childKey = this.setting.data.key.children;
checked = (checked !== false); checked = (checked !== false);
return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked); return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked);
}; }
zTreeTools.getChangeCheckedNodes = function() { zTreeTools.getChangeCheckedNodes = function() {
var childKey = this.setting.data.key.children; var childKey = this.setting.data.key.children;
return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]); return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]);
}; }
zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) { zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
disabled = !!disabled; disabled = !!disabled;
@ -206,7 +206,7 @@
inheritChildren = !!inheritChildren; inheritChildren = !!inheritChildren;
view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren); view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent); view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
}; }
var _updateNode = zTreeTools.updateNode; var _updateNode = zTreeTools.updateNode;
zTreeTools.updateNode = function(node, checkTypeFlag) { zTreeTools.updateNode = function(node, checkTypeFlag) {
@ -219,7 +219,7 @@
view.setChkClass(this.setting, checkObj, node); view.setChkClass(this.setting, checkObj, node);
view.repairParentChkClassWithSelf(this.setting, node); view.repairParentChkClassWithSelf(this.setting, node);
} }
}; }
}, },
//method of operate data //method of operate data
_data = { _data = {
@ -505,7 +505,7 @@
} else { } else {
obj.show(); obj.show();
} }
obj.attr("class", view.makeChkClass(setting, node)); obj.attr('class', view.makeChkClass(setting, node));
}, },
setParentNodeCheckBox: function(setting, node, value, srcNode) { setParentNodeCheckBox: function(setting, node, value, srcNode) {
var childKey = setting.data.key.children, var childKey = setting.data.key.children,
@ -604,7 +604,7 @@
if (_createNodes) _createNodes.apply(view, arguments); if (_createNodes) _createNodes.apply(view, arguments);
if (!nodes) return; if (!nodes) return;
view.repairParentChkClassWithSelf(setting, parentNode); view.repairParentChkClassWithSelf(setting, parentNode);
}; }
var _removeNode = view.removeNode; var _removeNode = view.removeNode;
view.removeNode = function(setting, node) { view.removeNode = function(setting, node) {
var parentNode = node.getParentNode(); var parentNode = node.getParentNode();
@ -612,7 +612,7 @@
if (!node || !parentNode) return; if (!node || !parentNode) return;
view.repairChkClass(setting, parentNode); view.repairChkClass(setting, parentNode);
view.repairParentChkClass(setting, parentNode); view.repairParentChkClass(setting, parentNode);
}; }
var _appendNodes = view.appendNodes; var _appendNodes = view.appendNodes;
view.appendNodes = function(setting, level, nodes, parentNode, initFlag, openFlag) { view.appendNodes = function(setting, level, nodes, parentNode, initFlag, openFlag) {
@ -624,5 +624,5 @@
data.makeChkFlag(setting, parentNode); data.makeChkFlag(setting, parentNode);
} }
return html; return html;
}; }
})(jQuery); })(jQuery);

4
src/case/clipboard/clipboard.js

@ -403,7 +403,7 @@ try {// IE8下会抛错
function _interopRequireDefault (obj) { function _interopRequireDefault (obj) {
return obj && obj.__esModule ? obj : { return obj && obj.__esModule ? obj : {
default: obj "default": obj
}; };
} }
@ -637,7 +637,7 @@ try {// IE8下会抛错
function _interopRequireDefault (obj) { function _interopRequireDefault (obj) {
return obj && obj.__esModule ? obj : { return obj && obj.__esModule ? obj : {
default: obj "default": obj
}; };
} }

150
src/core/jquery.js vendored

@ -169,7 +169,7 @@
return this; return this;
// HANDLE: $(#id) // HANDLE: $(#id)
} } else {
elem = document.getElementById( match[2] ); elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns // Check parentNode to catch when Blackberry 4.6 returns
@ -189,7 +189,7 @@
this.context = document; this.context = document;
this.selector = selector; this.selector = selector;
return this; return this;
}
// HANDLE: $(expr, $(...)) // HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) { } else if ( !context || context.jquery ) {
@ -197,9 +197,9 @@
// HANDLE: $(expr, context) // HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr) // (which is just equivalent to: $(context).find(expr)
} } else {
return this.constructor( context ).find( selector ); return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement) // HANDLE: $(DOMElement)
} else if ( selector.nodeType ) { } else if ( selector.nodeType ) {
@ -1739,10 +1739,10 @@
// The following elements throw uncatchable exceptions if you // The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them. // attempt to add expando properties to them.
noData: { noData: {
embed: true, "embed": true,
// Ban all objects except for Flash (which handle expandos) // Ban all objects except for Flash (which handle expandos)
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet: true "applet": true
}, },
hasData: function( elem ) { hasData: function( elem ) {
@ -2427,8 +2427,8 @@
propFix: { propFix: {
tabindex: "tabIndex", tabindex: "tabIndex",
readonly: "readOnly", readonly: "readOnly",
for: "htmlFor", "for": "htmlFor",
class: "className", "class": "className",
maxlength: "maxLength", maxlength: "maxLength",
cellspacing: "cellSpacing", cellspacing: "cellSpacing",
cellpadding: "cellPadding", cellpadding: "cellPadding",
@ -2460,18 +2460,18 @@
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret; return ret;
} } else {
return ( elem[ name ] = value ); return ( elem[ name ] = value );
} }
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret; return ret;
} } else {
return elem[ name ]; return elem[ name ];
}
}
}, },
propHooks: { propHooks: {
@ -3780,18 +3780,18 @@
ridentifier = new RegExp( "^" + identifier + "$" ), ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = { matchExpr = {
ID: new RegExp( "^#(" + characterEncoding + ")" ), "ID": new RegExp( "^#(" + characterEncoding + ")" ),
CLASS: new RegExp( "^\\.(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
NAME: new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
TAG: new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
ATTR: new RegExp( "^" + attributes ), "ATTR": new RegExp( "^" + attributes ),
PSEUDO: new RegExp( "^" + pseudos ), "PSEUDO": new RegExp( "^" + pseudos ),
CHILD: new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is() // For use in libraries implementing .is()
// We use this for POS matching in `select` // We use this for POS matching in `select`
needsContext: new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
}, },
@ -4088,10 +4088,10 @@
}) ? }) ?
{} : {} :
{ {
href: function ( elem ) { "href": function( elem ) {
return elem.getAttribute( "href", 2 ); return elem.getAttribute( "href", 2 );
}, },
type: function ( elem ) { "type": function( elem ) {
return elem.getAttribute("type"); return elem.getAttribute("type");
} }
}; };
@ -4525,12 +4525,12 @@
// innerText usage removed for consistency of new lines (see #11153) // innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) { if ( typeof elem.textContent === "string" ) {
return elem.textContent; return elem.textContent;
} } else {
// Traverse its children // Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem ); ret += getText( elem );
} }
}
} else if ( nodeType === 3 || nodeType === 4 ) { } else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue; return elem.nodeValue;
} }
@ -4558,7 +4558,7 @@
}, },
preFilter: { preFilter: {
ATTR: function ( match ) { "ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape ); match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted // Move the given value to match[3] whether quoted or unquoted
@ -4571,7 +4571,7 @@
return match.slice( 0, 4 ); return match.slice( 0, 4 );
}, },
CHILD: function ( match ) { "CHILD": function( match ) {
/* matches from matchExpr["CHILD"] /* matches from matchExpr["CHILD"]
1 type (only|nth|...) 1 type (only|nth|...)
2 what (child|of-type) 2 what (child|of-type)
@ -4603,7 +4603,7 @@
return match; return match;
}, },
PSEUDO: function ( match ) { "PSEUDO": function( match ) {
var excess, var excess,
unquoted = !match[5] && match[2]; unquoted = !match[5] && match[2];
@ -4634,7 +4634,7 @@
filter: { filter: {
TAG: function ( nodeName ) { "TAG": function( nodeName ) {
if ( nodeName === "*" ) { if ( nodeName === "*" ) {
return function() { return true; }; return function() { return true; };
} }
@ -4645,7 +4645,7 @@
}; };
}, },
CLASS: function ( className ) { "CLASS": function( className ) {
var pattern = classCache[ className + " " ]; var pattern = classCache[ className + " " ];
return pattern || return pattern ||
@ -4655,7 +4655,7 @@
}); });
}, },
ATTR: function ( name, operator, check ) { "ATTR": function( name, operator, check ) {
return function( elem ) { return function( elem ) {
var result = Sizzle.attr( elem, name ); var result = Sizzle.attr( elem, name );
@ -4679,7 +4679,7 @@
}; };
}, },
CHILD: function ( type, what, argument, first, last ) { "CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth", var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last", forward = type.slice( -4 ) !== "last",
ofType = what === "of-type"; ofType = what === "of-type";
@ -4768,7 +4768,7 @@
}; };
}, },
PSEUDO: function ( pseudo, argument ) { "PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive // pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes // http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
@ -4808,7 +4808,7 @@
pseudos: { pseudos: {
// Potentially complex pseudos // Potentially complex pseudos
not: markFunction(function ( selector ) { "not": markFunction(function( selector ) {
// Trim the selector passed to compile // Trim the selector passed to compile
// to avoid treating leading and trailing // to avoid treating leading and trailing
// spaces as combinators // spaces as combinators
@ -4836,13 +4836,13 @@
}; };
}), }),
has: markFunction(function ( selector ) { "has": markFunction(function( selector ) {
return function( elem ) { return function( elem ) {
return Sizzle( selector, elem ).length > 0; return Sizzle( selector, elem ).length > 0;
}; };
}), }),
contains: markFunction(function ( text ) { "contains": markFunction(function( text ) {
return function( elem ) { return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
}; };
@ -4855,7 +4855,7 @@
// The matching of C against the element's language value is performed case-insensitively. // The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name." // The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo // http://www.w3.org/TR/selectors/#lang-pseudo
lang: markFunction( function ( lang ) { "lang": markFunction( function( lang ) {
// lang value must be a valid identifider // lang value must be a valid identifider
if ( !ridentifier.test(lang || "") ) { if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang ); Sizzle.error( "unsupported lang: " + lang );
@ -4877,36 +4877,36 @@
}), }),
// Miscellaneous // Miscellaneous
target: function ( elem ) { "target": function( elem ) {
var hash = window.location && window.location.hash; var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id; return hash && hash.slice( 1 ) === elem.id;
}, },
root: function ( elem ) { "root": function( elem ) {
return elem === docElem; return elem === docElem;
}, },
focus: function ( elem ) { "focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
}, },
// Boolean properties // Boolean properties
enabled: function ( elem ) { "enabled": function( elem ) {
return elem.disabled === false; return elem.disabled === false;
}, },
disabled: function ( elem ) { "disabled": function( elem ) {
return elem.disabled === true; return elem.disabled === true;
}, },
checked: function ( elem ) { "checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements // In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase(); var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
}, },
selected: function ( elem ) { "selected": function( elem ) {
// Accessing this property makes selected-by-default // Accessing this property makes selected-by-default
// options in Safari work properly // options in Safari work properly
if ( elem.parentNode ) { if ( elem.parentNode ) {
@ -4917,7 +4917,7 @@
}, },
// Contents // Contents
empty: function ( elem ) { "empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo // http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others // not comment, processing instructions, or others
@ -4931,25 +4931,25 @@
return true; return true;
}, },
parent: function ( elem ) { "parent": function( elem ) {
return !Expr.pseudos["empty"]( elem ); return !Expr.pseudos["empty"]( elem );
}, },
// Element/input types // Element/input types
header: function ( elem ) { "header": function( elem ) {
return rheader.test( elem.nodeName ); return rheader.test( elem.nodeName );
}, },
input: function ( elem ) { "input": function( elem ) {
return rinputs.test( elem.nodeName ); return rinputs.test( elem.nodeName );
}, },
button: function ( elem ) { "button": function( elem ) {
var name = elem.nodeName.toLowerCase(); var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button"; return name === "input" && elem.type === "button" || name === "button";
}, },
text: function ( elem ) { "text": function( elem ) {
var attr; var attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case // use getAttribute instead to test this case
@ -4959,19 +4959,19 @@
}, },
// Position-in-collection // Position-in-collection
first: createPositionalPseudo(function () { "first": createPositionalPseudo(function() {
return [ 0 ]; return [ 0 ];
}), }),
last: createPositionalPseudo(function ( matchIndexes, length ) { "last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ]; return [ length - 1 ];
}), }),
eq: createPositionalPseudo(function ( matchIndexes, length, argument ) { "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ]; return [ argument < 0 ? argument + length : argument ];
}), }),
even: createPositionalPseudo(function ( matchIndexes, length ) { "even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0; var i = 0;
for ( ; i < length; i += 2 ) { for ( ; i < length; i += 2 ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4979,7 +4979,7 @@
return matchIndexes; return matchIndexes;
}), }),
odd: createPositionalPseudo(function ( matchIndexes, length ) { "odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1; var i = 1;
for ( ; i < length; i += 2 ) { for ( ; i < length; i += 2 ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4987,7 +4987,7 @@
return matchIndexes; return matchIndexes;
}), }),
lt: createPositionalPseudo(function ( matchIndexes, length, argument ) { "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument; var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) { for ( ; --i >= 0; ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -4995,7 +4995,7 @@
return matchIndexes; return matchIndexes;
}), }),
gt: createPositionalPseudo(function ( matchIndexes, length, argument ) { "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument; var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) { for ( ; ++i < length; ) {
matchIndexes.push( i ); matchIndexes.push( i );
@ -5811,9 +5811,9 @@
if ( isSimple.test( qualifier ) ) { if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep); return jQuery.filter(qualifier, filtered, !keep);
} } else {
qualifier = jQuery.filter( qualifier, filtered ); qualifier = jQuery.filter( qualifier, filtered );
}
} }
return jQuery.grep(elements, function( elem ) { return jQuery.grep(elements, function( elem ) {
@ -6183,7 +6183,7 @@
dataType: "script", dataType: "script",
async: false, async: false,
global: false, global: false,
throws: true "throws": true
}); });
} else { } else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
@ -6781,22 +6781,22 @@
// Exclude the following css properties to add px // Exclude the following css properties to add px
cssNumber: { cssNumber: {
columnCount: true, "columnCount": true,
fillOpacity: true, "fillOpacity": true,
fontWeight: true, "fontWeight": true,
lineHeight: true, "lineHeight": true,
opacity: true, "opacity": true,
orphans: true, "orphans": true,
widows: true, "widows": true,
zIndex: true, "zIndex": true,
zoom: true "zoom": true
}, },
// Add in properties whose names you wish to fix before // Add in properties whose names you wish to fix before
// setting or getting the value // setting or getting the value
cssProps: { cssProps: {
// normalize float css property // normalize float css property
float: jQuery.support.cssFloat ? "cssFloat" : "styleFloat" "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
}, },
// Get and set the style property on a DOM Node // Get and set the style property on a DOM Node
@ -7227,7 +7227,7 @@
if ( computed ) { if ( computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block // Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { display: "inline-block" }, return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] ); curCSS, [ elem, "marginRight" ] );
} }
} }
@ -8734,10 +8734,10 @@
if ( percent < 1 && length ) { if ( percent < 1 && length ) {
return remaining; return remaining;
} } else {
deferred.resolveWith( elem, [ animation ] ); deferred.resolveWith( elem, [ animation ] );
return false; return false;
}
}, },
animation = deferred.promise({ animation = deferred.promise({
elem: elem, elem: elem,

Loading…
Cancel
Save