Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tinyDOM
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Louis
tinyDOM
Commits
1bf6305b
Commit
1bf6305b
authored
9 years ago
by
Commander-lol
Browse files
Options
Downloads
Patches
Plain Diff
Added previously missed files
parent
ee32a846
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dist/tinydom.js
+7
-1
7 additions, 1 deletion
dist/tinydom.js
dist/tinydom.min.js
+1
-1
1 addition, 1 deletion
dist/tinydom.min.js
with
8 additions
and
2 deletions
dist/tinydom.js
+
7
−
1
View file @
1bf6305b
(
function
()
{
'
use strict
'
;
'
use strict
'
;
var
proto
,
TinyDOMFunction
,
tinyDOM
;
...
...
@@ -44,6 +44,8 @@ TinyDOMFunction = function (selector) {
this
.
length
=
1
;
}
this
.
apiversion
=
"
1
"
;
return
this
;
};
...
...
@@ -58,6 +60,7 @@ if (!window.μ) {
if
(
!
window
.
mu
)
{
window
.
mu
=
tinyDOM
;
}
tinyDOM
.
fn
=
TinyDOMFunction
.
prototype
=
{
each
:
function
(
fn
)
{
var
l
=
this
.
length
;
...
...
@@ -198,6 +201,7 @@ tinyDOM.triggerOn = function (target, eventName, data, bubbles, cancelable) {
cancelable
=
tinyDOM
.
exists
(
cancelable
)
?
cancelable
:
true
;
target
.
dispatchEvent
(
new
CustomEvent
(
eventName
,
data
,
bubbles
,
cancelable
));
};
tinyDOM
.
json
=
{
keys
:
function
(
json
)
{
var
kys
=
[],
...
...
@@ -231,6 +235,7 @@ tinyDOM.json = {
}
}
};
tinyDOM
.
ajax
=
function
(
options
)
{
var
req
=
new
XMLHttpRequest
(),
_this
=
this
,
...
...
@@ -280,4 +285,5 @@ tinyDOM.ajax = function (options) {
req
.
send
(
params
.
data
);
return
req
;
};
}());
This diff is collapsed.
Click to expand it.
dist/tinydom.min.js
+
1
−
1
View file @
1bf6305b
/*! tinydom 2015-06-30 */
!
function
(){
"
use strict
"
;
var
a
,
b
,
c
;
Element
&&!
Element
.
prototype
.
matches
&&
(
a
=
Element
.
prototype
,
a
.
matches
=
a
.
matchesSelector
||
a
.
mozMatchesSelector
||
a
.
msMatchesSelector
||
a
.
oMatchesSelector
||
a
.
webkitMatchesSelector
),
b
=
function
(
a
){
var
c
,
d
,
e
;
if
(
!
(
this
instanceof
b
))
return
new
b
(
a
);
if
(
null
===
a
||
"
undefined
"
==
typeof
a
)
this
.
length
=
0
;
else
if
(
"
string
"
==
typeof
a
)
for
(
c
=
document
.
querySelectorAll
(
a
),
this
.
length
=
c
.
length
,
d
=
0
;
d
<
c
.
length
;
d
++
)
e
=
c
.
item
(
d
),
this
[
d
]
=
e
;
else
if
(
a
.
length
)
for
(
d
=
0
;
d
<
a
.
length
;
d
++
)
e
=
a
[
d
],
this
[
d
]
=
e
;
else
this
[
0
]
=
a
,
this
.
length
=
1
;
return
this
},
c
=
function
(
a
){
return
new
b
(
a
)},
window
.
μ
||
(
window
.
μ
=
c
),
window
.
mu
||
(
window
.
mu
=
c
),
c
.
fn
=
b
.
prototype
=
{
each
:
function
(
a
){
for
(
var
b
=
this
.
length
;
b
--
;)
a
(
b
,
this
[
b
],
this
);
return
this
},
on
:
function
(
a
,
b
,
c
){
return
"
string
"
==
typeof
b
?
this
.
each
(
function
(
d
,
e
){
e
.
addEventListener
(
a
,
function
(
a
){
var
d
=
a
.
target
,
f
=!
1
;
do
d
&&
d
.
matches
(
b
)?(
c
.
call
(
d
,
a
),
f
=!
0
):(
d
=
d
.
parentNode
,
d
&&
d
.
matches
&&
d
!==
e
||
(
f
=!
0
));
while
(
f
!==!
0
)})}):(
c
=
b
,
this
.
each
(
function
(
b
,
d
){
d
.
addEventListener
(
a
,
c
)})),
this
},
first
:
function
(){
return
"
undefined
"
!=
typeof
this
[
0
]?
c
(
this
[
0
]):
null
},
parent
:
function
(
a
){
var
b
=
this
[
0
].
parentNode
,
d
=!
0
;
if
(
c
.
exists
(
a
)){
for
(;
null
!==
b
&&
b
!==
document
;){
if
(
b
.
matches
(
a
)){
d
=!
1
;
break
}
b
=
b
.
parentNode
}
b
=
d
?
null
:
b
}
return
c
(
b
)},
children
:
function
(){
var
a
,
b
=
this
[
0
].
childNodes
,
d
=
[];
for
(
a
=
0
;
a
<
b
.
length
;
a
++
)
c
.
isElement
(
b
[
a
])
&&
d
.
push
(
b
[
a
]);
return
c
(
d
)},
data
:
function
(
a
,
b
){
return
"
undefined
"
!=
typeof
b
?(
this
.
each
(
function
(
c
,
d
){
d
.
setAttribute
(
"
data-
"
+
a
,
b
)}),
this
):
this
[
0
].
getAttribute
(
"
data-
"
+
a
)},
attr
:
function
(
a
,
b
){
return
"
undefined
"
!=
typeof
b
?(
this
.
each
(
function
(
c
,
d
){
d
.
setAttribute
(
a
,
b
)}),
this
):
this
[
0
].
getAttribute
(
a
)},
"
class
"
:
function
(
a
,
b
){
return
c
.
exists
(
b
)?
this
.
each
(
function
(
c
,
d
){
d
.
classList
.
toggle
(
a
,
b
)}):
this
.
each
(
function
(
b
,
c
){
c
.
classList
.
toggle
(
a
)}),
this
},
trigger
:
function
(
a
,
b
,
d
,
e
){
d
=
c
.
exists
(
d
)?
d
:
!
0
,
e
=
c
.
exists
(
e
)?
e
:
!
0
;
var
f
=
new
CustomEvent
(
a
,
b
,
d
,
e
);
return
this
.
each
(
function
(
a
,
b
){
b
.
dispatchEvent
(
f
)}),
this
}},
c
.
ready
=
function
(
a
){
document
.
addEventListener
(
"
DOMContentLoaded
"
,
a
)},
c
.
isElement
=
function
(
a
){
var
b
=!
1
;
try
{
b
=
a
instanceof
HTMLElement
}
catch
(
c
){
b
=
a
.
nodeType
&&
1
===
a
.
nodeType
}
return
b
},
c
.
exists
=
function
(
a
){
return
null
!==
a
&&
"
undefined
"
!=
typeof
a
},
c
.
byID
=
function
(
a
){
return
c
(
document
.
getElementById
(
a
))},
c
.
triggerOn
=
function
(
a
,
b
,
d
,
e
,
f
){
e
=
c
.
exists
(
e
)?
e
:
!
0
,
f
=
c
.
exists
(
f
)?
f
:
!
0
,
a
.
dispatchEvent
(
new
CustomEvent
(
b
,
d
,
e
,
f
))},
c
.
json
=
{
keys
:
function
(
a
){
var
b
,
c
=
[];
for
(
b
in
a
)
a
.
hasOwnProperty
(
b
)
&&
c
.
push
(
b
);
return
c
},
is
:
function
(
a
){
try
{
return
JSON
.
parse
(
a
),
null
!==
a
&&
"
undefined
"
!=
typeof
a
}
catch
(
b
){
return
!
1
}},
merge
:
function
(
a
,
b
){
if
(
this
.
exists
(
a
)
&&
this
.
exists
(
b
)){
var
c
;
for
(
c
in
b
)
b
.
hasOwnProperty
(
c
)
&&
(
a
[
c
]
=
b
[
c
]);
return
a
}
return
null
}},
c
.
ajax
=
function
(
a
){
var
b
,
c
,
d
=
new
XMLHttpRequest
,
e
=
{
method
:
"
GET
"
,
url
:
""
,
async
:
!
0
,
user
:
null
,
password
:
null
,
responseType
:
"
text
"
,
data
:
null
,
headers
:[],
callbacks
:{}},
f
=
function
(
a
){
return
function
(
b
){
a
(
b
.
currentTarget
.
response
,
b
)}};
if
(
this
.
merge
(
e
,
a
),
d
.
responseType
=
e
.
responseType
,
this
.
exists
(
e
.
callbacks
))
for
(
b
in
e
.
callbacks
)
e
.
callbacks
.
hasOwnProperty
(
b
)
&&
d
.
addEventListener
(
b
,
f
(
e
.
callbacks
[
b
]));
for
(
d
.
open
(
e
.
method
,
e
.
url
,
e
.
async
,
e
.
user
,
e
.
password
),
c
=
0
;
c
<
e
.
headers
.
length
;
c
++
)
d
.
setRequestHeader
(
e
.
headers
[
c
].
header
,
e
.
headers
[
c
].
value
);
return
d
.
send
(
e
.
data
),
d
}}();
!
function
(){
"
use strict
"
;
var
a
,
b
,
c
;
Element
&&!
Element
.
prototype
.
matches
&&
(
a
=
Element
.
prototype
,
a
.
matches
=
a
.
matchesSelector
||
a
.
mozMatchesSelector
||
a
.
msMatchesSelector
||
a
.
oMatchesSelector
||
a
.
webkitMatchesSelector
),
b
=
function
(
a
){
var
c
,
d
,
e
;
if
(
!
(
this
instanceof
b
))
return
new
b
(
a
);
if
(
null
===
a
||
"
undefined
"
==
typeof
a
)
this
.
length
=
0
;
else
if
(
"
string
"
==
typeof
a
)
for
(
c
=
document
.
querySelectorAll
(
a
),
this
.
length
=
c
.
length
,
d
=
0
;
d
<
c
.
length
;
d
++
)
e
=
c
.
item
(
d
),
this
[
d
]
=
e
;
else
if
(
a
.
length
)
for
(
d
=
0
;
d
<
a
.
length
;
d
++
)
e
=
a
[
d
],
this
[
d
]
=
e
;
else
this
[
0
]
=
a
,
this
.
length
=
1
;
return
this
.
apiversion
=
"
1
"
,
this
},
c
=
function
(
a
){
return
new
b
(
a
)},
window
.
μ
||
(
window
.
μ
=
c
),
window
.
mu
||
(
window
.
mu
=
c
),
c
.
fn
=
b
.
prototype
=
{
each
:
function
(
a
){
for
(
var
b
=
this
.
length
;
b
--
;)
a
(
b
,
this
[
b
],
this
);
return
this
},
on
:
function
(
a
,
b
,
c
){
return
"
string
"
==
typeof
b
?
this
.
each
(
function
(
d
,
e
){
e
.
addEventListener
(
a
,
function
(
a
){
var
d
=
a
.
target
,
f
=!
1
;
do
d
&&
d
.
matches
(
b
)?(
c
.
call
(
d
,
a
),
f
=!
0
):(
d
=
d
.
parentNode
,
d
&&
d
.
matches
&&
d
!==
e
||
(
f
=!
0
));
while
(
f
!==!
0
)})}):(
c
=
b
,
this
.
each
(
function
(
b
,
d
){
d
.
addEventListener
(
a
,
c
)})),
this
},
first
:
function
(){
return
"
undefined
"
!=
typeof
this
[
0
]?
c
(
this
[
0
]):
null
},
parent
:
function
(
a
){
var
b
=
this
[
0
].
parentNode
,
d
=!
0
;
if
(
c
.
exists
(
a
)){
for
(;
null
!==
b
&&
b
!==
document
;){
if
(
b
.
matches
(
a
)){
d
=!
1
;
break
}
b
=
b
.
parentNode
}
b
=
d
?
null
:
b
}
return
c
(
b
)},
children
:
function
(){
var
a
,
b
=
this
[
0
].
childNodes
,
d
=
[];
for
(
a
=
0
;
a
<
b
.
length
;
a
++
)
c
.
isElement
(
b
[
a
])
&&
d
.
push
(
b
[
a
]);
return
c
(
d
)},
data
:
function
(
a
,
b
){
return
"
undefined
"
!=
typeof
b
?(
this
.
each
(
function
(
c
,
d
){
d
.
setAttribute
(
"
data-
"
+
a
,
b
)}),
this
):
this
[
0
].
getAttribute
(
"
data-
"
+
a
)},
attr
:
function
(
a
,
b
){
return
"
undefined
"
!=
typeof
b
?(
this
.
each
(
function
(
c
,
d
){
d
.
setAttribute
(
a
,
b
)}),
this
):
this
[
0
].
getAttribute
(
a
)},
"
class
"
:
function
(
a
,
b
){
return
c
.
exists
(
b
)?
this
.
each
(
function
(
c
,
d
){
d
.
classList
.
toggle
(
a
,
b
)}):
this
.
each
(
function
(
b
,
c
){
c
.
classList
.
toggle
(
a
)}),
this
},
trigger
:
function
(
a
,
b
,
d
,
e
){
d
=
c
.
exists
(
d
)?
d
:
!
0
,
e
=
c
.
exists
(
e
)?
e
:
!
0
;
var
f
=
new
CustomEvent
(
a
,
b
,
d
,
e
);
return
this
.
each
(
function
(
a
,
b
){
b
.
dispatchEvent
(
f
)}),
this
}},
c
.
ready
=
function
(
a
){
document
.
addEventListener
(
"
DOMContentLoaded
"
,
a
)},
c
.
isElement
=
function
(
a
){
var
b
=!
1
;
try
{
b
=
a
instanceof
HTMLElement
}
catch
(
c
){
b
=
a
.
nodeType
&&
1
===
a
.
nodeType
}
return
b
},
c
.
exists
=
function
(
a
){
return
null
!==
a
&&
"
undefined
"
!=
typeof
a
},
c
.
byID
=
function
(
a
){
return
c
(
document
.
getElementById
(
a
))},
c
.
triggerOn
=
function
(
a
,
b
,
d
,
e
,
f
){
e
=
c
.
exists
(
e
)?
e
:
!
0
,
f
=
c
.
exists
(
f
)?
f
:
!
0
,
a
.
dispatchEvent
(
new
CustomEvent
(
b
,
d
,
e
,
f
))},
c
.
json
=
{
keys
:
function
(
a
){
var
b
,
c
=
[];
for
(
b
in
a
)
a
.
hasOwnProperty
(
b
)
&&
c
.
push
(
b
);
return
c
},
is
:
function
(
a
){
try
{
return
JSON
.
parse
(
a
),
null
!==
a
&&
"
undefined
"
!=
typeof
a
}
catch
(
b
){
return
!
1
}},
merge
:
function
(
a
,
b
){
if
(
this
.
exists
(
a
)
&&
this
.
exists
(
b
)){
var
c
;
for
(
c
in
b
)
b
.
hasOwnProperty
(
c
)
&&
(
a
[
c
]
=
b
[
c
]);
return
a
}
return
null
}},
c
.
ajax
=
function
(
a
){
var
b
,
c
,
d
=
new
XMLHttpRequest
,
e
=
{
method
:
"
GET
"
,
url
:
""
,
async
:
!
0
,
user
:
null
,
password
:
null
,
responseType
:
"
text
"
,
data
:
null
,
headers
:[],
callbacks
:{}},
f
=
function
(
a
){
return
function
(
b
){
a
(
b
.
currentTarget
.
response
,
b
)}};
if
(
this
.
merge
(
e
,
a
),
d
.
responseType
=
e
.
responseType
,
this
.
exists
(
e
.
callbacks
))
for
(
b
in
e
.
callbacks
)
e
.
callbacks
.
hasOwnProperty
(
b
)
&&
d
.
addEventListener
(
b
,
f
(
e
.
callbacks
[
b
]));
for
(
d
.
open
(
e
.
method
,
e
.
url
,
e
.
async
,
e
.
user
,
e
.
password
),
c
=
0
;
c
<
e
.
headers
.
length
;
c
++
)
d
.
setRequestHeader
(
e
.
headers
[
c
].
header
,
e
.
headers
[
c
].
value
);
return
d
.
send
(
e
.
data
),
d
}}();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment