Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
a155231f
Commit
a155231f
authored
Jul 13, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Commit.
parent
9477c418
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
106 deletions
+108
-106
tmpl.js
tmpl/tmpl.js
+108
-106
No files found.
tmpl/tmpl.js
View file @
a155231f
$
.
fn
.
get
=
function
(
i
)
{
// test commit
return
i
==
null
?
this
.
$$unclean
?
$
.
sibling
(
this
.
$$unclean
[
0
])
:
this
.
cur
:
$
.
fn
.
get
=
function
(
i
)
{
(
this
.
get
())[
i
];
return
i
==
null
?
};
this
.
$$unclean
?
$
.
sibling
(
this
.
$$unclean
[
0
])
:
this
.
cur
:
(
this
.
get
())[
i
];
$
.
fn
.
_get
=
function
(
i
)
{
};
return
i
==
null
?
this
.
cur
:
this
.
cur
[
i
];
};
$
.
fn
.
_get
=
function
(
i
)
{
return
i
==
null
?
this
.
cur
:
this
.
cur
[
i
];
$
.
fn
.
set
=
function
(
a
,
b
)
{
};
return
this
.
each
(
function
(){
if
(
b
==
null
)
$
.
fn
.
set
=
function
(
a
,
b
)
{
for
(
var
j
in
a
)
return
this
.
each
(
function
(){
this
[
$
.
attr
(
j
)]
=
a
[
j
];
if
(
b
==
null
)
else
{
for
(
var
j
in
a
)
if
(
b
.
constructor
!=
String
)
{
// TODO: Fix this
this
[
$
.
attr
(
j
)]
=
a
[
j
];
for
(
var
i
in
b
)
{
else
{
var
c
=
$
.
Select
(
i
,
this
);
if
(
b
.
constructor
!=
String
)
{
// TODO: Fix this
for
(
var
j
in
c
)
for
(
var
i
in
b
)
{
c
[
j
][
$
.
attr
(
a
)]
=
b
[
i
];
var
c
=
$
.
Select
(
i
,
this
);
}
for
(
var
j
in
c
)
}
else
c
[
j
][
$
.
attr
(
a
)]
=
b
[
i
];
this
[
$
.
attr
(
a
)]
=
b
;
}
}
}
else
});
this
[
$
.
attr
(
a
)]
=
b
;
};
}
});
function
$C
(
a
)
{
};
if
(
a
.
indexOf
(
'<'
)
>=
0
)
{
if
(
a
.
indexOf
(
'<tr'
)
>=
0
)
{
function
$C
(
a
)
{
var
r
=
$C
(
"table"
).
html
(
"<tbody>"
+
a
+
"</tbody>"
);
if
(
a
.
indexOf
(
'<'
)
>=
0
)
{
r
.
$$unclean
=
r
.
get
(
0
).
childNodes
[
0
].
childNodes
;
if
(
a
.
indexOf
(
'<tr'
)
>=
0
)
{
}
else
{
var
r
=
$C
(
"table"
).
html
(
"<tbody>"
+
a
+
"</tbody>"
);
var
r
=
$C
(
"div"
).
html
(
a
);
r
.
$$unclean
=
r
.
get
(
0
).
childNodes
[
0
].
childNodes
;
r
.
$$unclean
=
r
.
get
(
0
).
childNodes
;
}
else
{
}
var
r
=
$C
(
"div"
).
html
(
a
);
return
r
;
r
.
$$unclean
=
r
.
get
(
0
).
childNodes
;
}
else
{
}
return
$
(
document
.
createElement
(
a
),
document
);
return
r
;
}
}
else
{
};
return
$
(
document
.
createElement
(
a
),
document
);
}
$
.
fn
.
appendTo
=
function
()
{
};
var
self
=
this
;
var
a
=
arguments
;
$
.
fn
.
appendTo
=
function
()
{
return
this
.
each
(
function
(){
var
self
=
this
;
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
var
a
=
arguments
;
if
(
self
.
$$unclean
)
return
this
.
each
(
function
(){
$
(
a
[
i
]).
append
(
self
.
get
()
);
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
else
if
(
self
.
$$unclean
)
$
(
a
[
i
]).
append
(
this
);
$
(
a
[
i
]).
append
(
self
.
get
()
);
}
else
});
$
(
a
[
i
]).
append
(
this
);
};
}
});
$
.
clean
=
function
(
a
)
{
};
var
r
=
[];
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
$
.
clean
=
function
(
a
)
{
if
(
a
[
i
].
constructor
==
String
)
{
var
r
=
[];
// Cool, but has scary side-effects
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
//a[i] = a[i].replace( /#([a-zA-Z0-9_-]+)/g, " id='$1' " );
if
(
a
[
i
].
constructor
==
String
)
{
//a[i] = a[i].replace( /\.([a-zA-Z0-9_-]+)/g, " class='$1' " );
// Cool, but has scary side-effects
var
div
=
document
.
createElement
(
"div"
);
//a[i] = a[i].replace( /#([a-zA-Z0-9_-]+)/g, " id='$1' " );
div
.
innerHTML
=
a
[
i
];
//a[i] = a[i].replace( /\.([a-zA-Z0-9_-]+)/g, " class='$1' " );
for
(
var
j
=
0
;
j
<
div
.
childNodes
.
length
;
j
++
)
var
div
=
document
.
createElement
(
"div"
);
r
[
r
.
length
]
=
div
.
childNodes
[
j
];
div
.
innerHTML
=
a
[
i
];
}
else
if
(
a
[
i
].
length
)
{
for
(
var
j
=
0
;
j
<
div
.
childNodes
.
length
;
j
++
)
for
(
var
j
=
0
;
j
<
a
[
i
].
length
;
j
++
)
r
[
r
.
length
]
=
div
.
childNodes
[
j
];
r
[
r
.
length
]
=
a
[
i
][
j
];
}
else
if
(
a
[
i
].
length
)
{
}
else
{
for
(
var
j
=
0
;
j
<
a
[
i
].
length
;
j
++
)
r
[
r
.
length
]
=
a
[
i
];
r
[
r
.
length
]
=
a
[
i
][
j
];
}
}
else
{
}
r
[
r
.
length
]
=
a
[
i
];
return
r
;
}
};
}
return
r
;
// Frequently-used Accessors
};
window
.
cssQuery
=
$
.
Select
;
document
.
getElementsByClass
=
function
(
a
){
return
$
.
Select
(
"."
+
a
)};
// Frequently-used Accessors
document
.
getElementsBySelector
=
$
.
Select
;
window
.
cssQuery
=
$
.
Select
;
document
.
getElementsByClass
=
function
(
a
){
return
$
.
Select
(
"."
+
a
)};
document
.
getElementsBySelector
=
$
.
Select
;
// Make Xpath Axes Sane
//var re = new RegExp( "/?descendant::", "i" );
//t = t.replace( re, " " );
// Make Xpath Axes Sane
//var re = new RegExp( "/?child::", "i" );
//var re = new RegExp( "/?descendant::", "i" );
//t = t.replace( re, "/" );
//t = t.replace( re, " " );
// If only...
//var re = new RegExp( "/?child::", "i" );
//var re = new RegExp( "/?following-sibling::", "i" );
//t = t.replace( re, "/" );
//t = t.replace( re, " + " );
// If only...
//var re = new RegExp( "/?preceding-sibling::", "i" );
//var re = new RegExp( "/?following-sibling::", "i" );
//t = t.replace( re, " ~ " );
//t = t.replace( re, " + " );
//var re = new RegExp( "/?self::", "i" );
//var re = new RegExp( "/?preceding-sibling::", "i" );
//t = t.replace( re, "" );
//t = t.replace( re, " ~ " );
//var re = new RegExp( "/?parent::", "i" );
//var re = new RegExp( "/?self::", "i" );
//t = t.replace( re, " .. " );
//t = t.replace( re, "" );
//var re = new RegExp( "/?parent::", "i" );
// following
//t = t.replace( re, " .. " );
// preceding
// ancestor
// following
// ancestor-or-self
// preceding
// descendant-or-self
// ancestor
// ancestor-or-self
// Deprecated
// descendant-or-self
//style: function(a,b){ return this.css(a,b); },
// Deprecated
//style: function(a,b){ return this.css(a,b); },
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment