Skip to content

Commit d208b3f

Browse files
authored
Merge pull request #36 from gdcc/develop
v0.3 Updates
2 parents 3be8983 + b232742 commit d208b3f

File tree

6 files changed

+1278
-1042
lines changed

6 files changed

+1278
-1042
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# dvwebloader
22
A web tool for uploading folders of files to a Dataverse dataset. See [the wiki](https://github.com/gdcc/dvwebloader/wiki) for further details.
33

4-
Hosted at https://gdcc.github.io/dvwebloader
4+
The Hosted version at https://gdcc.github.io/dvwebloader can be used for testing. You should fork or install a local copy for production use (to avoid changes made in this repository immediately being available from your Dataverse installation.)
5+
You may also want to run the localinstall.sh script in the directory you download to to make and local copies of the libraries used.
56

67
### Current integration mechanism (v5.13+):
78

localinstall.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
echo Creating version of DVWebloader that uses only local libraries
4+
echo Run this script in the directory with the dvwebloader.html file
5+
6+
7+
dirLocal=$(pwd)
8+
9+
echo Downloading local copies of remote JavaScript libraries:
10+
sed -n 's/.*src="\(http[^"]*\)".*/\1/p' *.html | sort -u | sed -n 's/^\(.*\/\)*\(.*\)/sed -i \x27s,\0\,lib\/\2,\x27 *.html/p' > replace_js.sh
11+
sed -n 's/.*src="\(http[^"]*\)".*/\1/p' *.html | sort -u > urls_js.txt
12+
source replace_js.sh
13+
cat urls_js.txt
14+
15+
echo Downloading local copies of remote JavaScript libraries referenced in js files:
16+
cd ./js
17+
sed -n 's/.*src[ ]*=[ ]*"\(http[^"]*\)".*/\1/p' *.js | sort -u | sed -n 's/^\(.*\/\)*\(.*\)/sed -i \x27s,\0\,lib\/\2,\x27 *.js/p' > replacejs_js.sh
18+
sed -n 's/.*src[ ]*=[ ]*"\(http[^"]*\)".*/\1/p' *.js | sort -u > urlsjs_js.txt
19+
source replacejs_js.sh
20+
cat urlsjs_js.txt
21+
cd ..
22+
23+
echo Downloading local copies of remote CSS files:
24+
sed -n 's/.*<link.*href="\(http[^"]*\)".*/\1/p' *.html | sort -u | sed -n 's/^\(.*\/\)*\(.*\)/sed -i \x27s,\0\,lib\/\2,\x27 *.html/p' > replace_css.sh
25+
sed -n 's/.*<link.*href="\(http[^"]*\)".*/\1/p' *.html | sort -u > urls_css.txt
26+
source replace_css.sh
27+
cat urls_css.txt
28+
29+
if [ ! -d ./lib ]; then
30+
mkdir ./lib
31+
fi
32+
cd ./lib
33+
while read url; do
34+
wget --quiet $url
35+
done < "../urls_js.txt"
36+
while read url; do
37+
wget --quiet $url
38+
done < "../js/urlsjs_js.txt"
39+
40+
41+
cd ".."
42+
if [ ! -d ./css ]; then
43+
mkdir ./css
44+
fi
45+
cd ./css
46+
while read url; do
47+
wget --quiet $url
48+
done < "../urls_css.txt"
49+
50+
cd ..
51+
52+
53+
echo Cleaning Up...
54+
rm urls_js.txt
55+
rm urls_css.txt
56+
rm replace_js.sh
57+
rm replace_css.sh
58+
rm js/urlsjs_js.txt
59+
rm js/replacejs_js.sh
60+
61+
echo Done
62+
exit 0

src/css/dvwebloader.css

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
}
44
.ui-fileupload-row {
55
display: inline-flex;
6-
width: 90%;
6+
width: 100%;
77
}
88
.ui-fileupload-row > div {
99
padding: 5px;
1010
}
11-
.ui-fileupload-row{
12-
display:table-row;
13-
}
1411
.ui-fileupload-row>div{
1512
display:table-cell;
1613
padding:4px 10px;
@@ -26,7 +23,7 @@ label {
2623
-webkit-border-radius: 4px;
2724
-moz-border-radius: 4px;
2825
border-radius: 4px;
29-
border: solid 1px #20538D;
26+
border: solid 2px #20538D;
3027
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
3128
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
3229
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
@@ -37,6 +34,22 @@ label {
3734
text-decoration: none;
3835
margin: 20px;
3936
}
37+
.button-sm {
38+
-webkit-border-radius: 4px;
39+
-moz-border-radius: 4px;
40+
border-radius: 4px;
41+
border: solid 2px #20538D;
42+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
43+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
44+
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
45+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
46+
margin: 5px;
47+
}
48+
.input-sm {
49+
margin-left:10px;
50+
width: 80px;
51+
display:inline-block;
52+
}
4053
.success {
4154
background-color: lightgreen;
4255
padding: 10px;
@@ -45,6 +58,10 @@ label {
4558
background-color: beige;
4659
padding: 10px;
4760
}
61+
.warn {
62+
background-color: bisque;
63+
padding: 10px;
64+
}
4865
.file-exists {
4966
background-color: lightblue;
5067
}
@@ -67,3 +84,17 @@ h1 {
6784
width: 58%;
6885
display:inline-block;
6986
}
87+
.button:disabled {
88+
background: gray;
89+
border-color: gray!important;
90+
}
91+
.button:hover {
92+
border-color: lightblue;
93+
}
94+
.button-sm:hover {
95+
border-color: lightblue;
96+
}
97+
.badchars {
98+
background-color: bisque;
99+
padding: 10px;
100+
}

src/dvwebloader.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<head>
44
<title>Dataverse WebLoader</title>
55
<link type="text/css" rel="stylesheet" href="css/dvwebloader.css">
6-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
7-
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/core.js"></script>
6+
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
7+
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/core.js"></script>
88
<script type="module" src="js/fileupload2.js"></script>
99
<script src="js/logoHandler.js"></script>
1010

@@ -26,7 +26,7 @@ <h1><span id="title-text">Folder Upload</span></h1>
2626
</div>
2727
<div id="filelist"></div>
2828
<div id="credit">
29-
<a href='https://github.com/gdcc/dvwebloader' target='_blank'>DVWebloader v0.2</a><span id="sponsor-text">, development sponsored by UiT/DataverseNO</span>
29+
<a href='https://github.com/gdcc/dvwebloader' target='_blank'>DVWebloader v0.3</a><span id="sponsor-text">, development sponsored by UiT/DataverseNO</span>
3030
</div>
3131
<script>
3232
var input = document

0 commit comments

Comments
 (0)