Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
3b9ec81a
Commit
3b9ec81a
authored
Dec 27, 2017
by
S Anand
Browse files
REF: refactor functions into separate files
parent
4bf6bfeb
Pipeline
#38232
passed with stage
in 1 minute and 18 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
index-event.js
0 → 100644
View file @
3b9ec81a
export
{
version
}
from
'
./src/package.js
'
import
{
dispatch
}
from
'
./src/jquery.dispatch.js
'
if
(
typeof
jQuery
!=
'
undefined
'
)
{
jQuery
.
extend
(
jQuery
.
fn
,
{
dispatch
:
dispatch
})
}
index-
jquery
.js
→
index-
template
.js
View file @
3b9ec81a
export
{
version
}
from
'
./src/package.js
'
import
{
dispatch
}
from
'
./src/jquery.dispatch.js
'
import
{
template
}
from
'
./src/jquery.template.js
'
if
(
typeof
jQuery
!=
'
undefined
'
)
{
jQuery
.
extend
(
jQuery
.
fn
,
{
dispatch
:
dispatch
,
template
:
template
})
}
index.js
View file @
3b9ec81a
export
{
version
}
from
'
./src/package.js
'
export
{
url
}
from
'
./index-urlfilter.js
'
import
'
./index-jquery.js
'
import
'
./index-template.js
'
import
'
./index-event.js
'
import
'
./index-leaflet.js
'
rollup.config.js
View file @
3b9ec81a
...
...
@@ -11,13 +11,23 @@ export default [
output
:
{
file
:
"
dist/g1.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1
"
}
},
{
input
:
"
index-
jqu
er
y
"
,
input
:
"
index-
urlfilt
er
"
,
plugins
:
[
uglify
()
],
output
:
{
file
:
"
dist/jquery.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1_jquery
"
}
output
:
{
file
:
"
dist/urlfilter.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1
"
}
},
{
input
:
"
index-template
"
,
plugins
:
[
uglify
()],
output
:
{
file
:
"
dist/template.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1._modules
"
}
},
{
input
:
"
index-event
"
,
plugins
:
[
uglify
()],
output
:
{
file
:
"
dist/event.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1._modules
"
}
},
{
input
:
"
index-leaflet
"
,
plugins
:
[
uglify
()
],
output
:
{
file
:
"
dist/leaflet.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1
_leaflet
"
}
output
:
{
file
:
"
dist/leaflet.min.js
"
,
format
:
"
umd
"
,
name
:
"
g1
._modules
"
}
}
]
test/server.js
View file @
3b9ec81a
const
path
=
require
(
'
path
'
)
const
express
=
require
(
'
express
'
)
const
paths
=
[
'
test/
jquery.
urlfilter.html
'
,
'
test/
jquery.dispatch
.html
'
,
'
test/
jquery.template
.html
'
,
'
test/
test-
urlfilter.html
'
,
'
test/
test-template
.html
'
,
'
test/
test-event
.html
'
,
'
test/leaflet.topojson.html
'
]
const
port
=
process
.
argv
.
length
<=
2
?
1112
:
1111
...
...
test/
jquery.dispatch
.html
→
test/
test-event
.html
View file @
3b9ec81a
...
...
@@ -3,7 +3,7 @@
<head>
<title>
dispatch tests
</title>
<script
src=
"../node_modules/jquery/dist/jquery.min.js"
></script>
<script
src=
"../dist/
g1
.js"
></script>
<script
src=
"../dist/
event.min
.js"
></script>
<script
src=
"tape.js"
></script>
</head>
<body>
...
...
test/test-g1.html
0 → 100644
View file @
3b9ec81a
<!DOCTYPE html>
<html>
<head>
<title>
urlfilter tests
</title>
<script
src=
"../node_modules/jquery/dist/jquery.min.js"
></script>
<script
src=
"../node_modules/leaflet/dist/leaflet.js"
></script>
<script
src=
"../dist/g1.min.js"
></script>
<script
src=
"tape.js"
></script>
</head>
<body>
<script>
tape
.
onFinish
(
function
()
{
window
.
renderComplete
=
true
})
</script>
<script>
tape
(
'
g1 attributes exist
'
,
function
(
t
)
{
t
.
ok
(
typeof
g1
==
'
object
'
,
'
g1
'
)
t
.
ok
(
typeof
g1
.
version
==
'
string
'
,
'
g1.version
'
)
t
.
ok
(
typeof
g1
.
url
==
'
object
'
,
'
g1.url
'
)
t
.
ok
(
typeof
g1
.
url
.
parse
==
'
function
'
,
'
g1.url.parse
'
)
t
.
ok
(
typeof
g1
.
url
.
join
==
'
function
'
,
'
g1.url.join
'
)
t
.
ok
(
typeof
g1
.
url
.
update
==
'
function
'
,
'
g1.url.update
'
)
t
.
ok
(
typeof
$
.
fn
.
urlfilter
==
'
function
'
,
'
$.fn.urlfilter
'
)
t
.
ok
(
typeof
$
.
fn
.
template
==
'
function
'
,
'
$.fn.template
'
)
t
.
ok
(
typeof
$
.
fn
.
dispatch
==
'
function
'
,
'
$.fn.dispatch
'
)
t
.
ok
(
typeof
L
.
TopoJSON
==
'
function
'
,
'
L.TopoJSON
'
)
t
.
end
()
})
</script>
</body>
</html>
test/
jquery.
template.html
→
test/
test-
template.html
View file @
3b9ec81a
...
...
@@ -4,7 +4,7 @@
<title>
template tests
</title>
<script
src=
"../node_modules/jquery/dist/jquery.min.js"
></script>
<script
src=
"../node_modules/lodash/lodash.min.js"
></script>
<script
src=
"../dist/
g1
.js"
></script>
<script
src=
"../dist/
template.min
.js"
></script>
<script
src=
"tape.js"
></script>
</head>
<body>
...
...
test/
jquery.
urlfilter.html
→
test/
test-
urlfilter.html
View file @
3b9ec81a
...
...
@@ -3,7 +3,8 @@
<head>
<title>
urlfilter tests
</title>
<script
src=
"../node_modules/jquery/dist/jquery.min.js"
></script>
<script
src=
"../dist/g1.js"
></script>
<script
src=
"../dist/urlfilter.min.js"
></script>
<script
src=
"../dist/event.min.js"
></script>
<script
src=
"../node_modules/component-emitter/index.js"
></script>
<script
src=
"tape.js"
></script>
<script
class=
"test-utilities"
>
...
...
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