Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
die_coolen_jungs
our_own_cloud_project
Commits
6822185c
Commit
6822185c
authored
15 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
added option to delete multiply files and fixed a bug when downloading large files
parent
f16f1e50
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
files/get_file.php
+1
-1
1 addition, 1 deletion
files/get_file.php
js/lib_files.js
+78
-15
78 additions, 15 deletions
js/lib_files.js
with
79 additions
and
16 deletions
files/get_file.php
+
1
−
1
View file @
6822185c
...
...
@@ -100,7 +100,7 @@ header('Expires: 0');
header
(
'Cache-Control: must-revalidate, post-check=0, pre-check=0'
);
header
(
'Pragma: public'
);
header
(
'Content-Length: '
.
filesize
(
$filename
));
ob_clean
();
ob_
end_
clean
();
readfile
(
$filename
);
if
(
$zip
){
unlink
(
$filename
);
...
...
This diff is collapsed.
Click to expand it.
js/lib_files.js
+
78
−
15
View file @
6822185c
...
...
@@ -146,6 +146,32 @@ OC_FILES.showbrowser_callback=function(content){
var
filesfound
=
false
;
var
sizeTd
=
null
;
if
(
content
){
tr
=
document
.
createElement
(
'
tr
'
);
tbody
.
appendChild
(
tr
);
tr
.
className
=
'
browserline
'
;
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
td
.
setAttribute
(
'
colspan
'
,
'
2
'
);
input
=
document
.
createElement
(
'
input
'
);
input
.
setAttribute
(
'
type
'
,
'
checkbox
'
);
input
.
setAttribute
(
'
name
'
,
'
fileSelector
'
);
input
.
setAttribute
(
'
value
'
,
'
select_all
'
);
input
.
setAttribute
(
'
id
'
,
'
select_all
'
);
input
.
setAttribute
(
'
onclick
'
,
'
OC_FILES.selectAll()
'
);
td
.
appendChild
(
input
);
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
td
.
className
=
'
nametext
'
;
td
.
setAttribute
(
'
name
'
,
'
name
'
);
td
.
appendChild
(
document
.
createTextNode
(
'
name
'
))
sizeTd
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
sizeTd
);
sizeTd
.
className
=
'
sizetext
'
;
sizeTd
.
appendChild
(
document
.
createTextNode
(
'
size
'
));
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
td
.
className
=
'
sizetext
'
;
td
.
appendChild
(
document
.
createTextNode
(
'
date
'
));
for
(
index
in
content
){
file
=
content
[
index
];
if
(
file
.
name
){
...
...
@@ -185,8 +211,6 @@ OC_FILES.showbrowser_callback=function(content){
img
.
alt
=
'
rename
'
img
.
title
=
'
rename
'
;
img
.
src
=
WEBROOT
+
'
/img/icons/rename.png
'
;
img
.
style
.
height
=
'
16px
'
img
.
style
.
width
=
'
16px
'
img
.
setAttribute
(
'
onclick
'
,
'
OC_FILES.rename(
\'
'
+
dir
+
'
\'
,
\'
'
+
file
[
'
name
'
]
+
'
\'
)
'
)
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
...
...
@@ -201,8 +225,6 @@ OC_FILES.showbrowser_callback=function(content){
img
.
alt
=
'
delete
'
img
.
title
=
'
delete
'
;
img
.
src
=
WEBROOT
+
'
/img/icons/delete.png
'
;
img
.
style
.
height
=
'
16px
'
img
.
style
.
width
=
'
16px
'
img
.
setAttribute
(
'
onclick
'
,
'
OC_FILES.remove(
\'
'
+
dir
+
'
\'
,
\'
'
+
file
[
'
name
'
]
+
'
\'
)
'
)
}
}
...
...
@@ -213,20 +235,32 @@ OC_FILES.showbrowser_callback=function(content){
tr
.
className
=
'
utilrow
'
;
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
td
.
className
=
'
upload
'
;
td
.
setAttribute
(
'
colspan
'
,
'
6
'
);
this
.
showuploader
(
dir
,
td
,
content
[
'
max_upload
'
]);
dropdown
=
document
.
createElement
(
'
select
'
);
td
.
appendChild
(
dropdown
);
dropdown
.
setAttribute
(
'
id
'
,
'
selected_action
'
);
for
(
index
in
this
.
actions_selected
){
if
(
this
.
actions_selected
[
index
].
call
){
option
=
document
.
createElement
(
'
option
'
);
dropdown
.
appendChild
(
option
);
option
.
setAttribute
(
'
value
'
,
index
);
option
.
appendChild
(
document
.
createTextNode
(
index
));
}
}
td
.
appendChild
(
document
.
createTextNode
(
'
selected.
'
));
button
=
document
.
createElement
(
'
input
'
);
td
.
appendChild
(
button
);
button
.
setAttribute
(
'
type
'
,
'
button
'
);
button
.
setAttribute
(
'
value
'
,
'
Go
'
);
button
.
setAttribute
(
'
onclick
'
,
'
OC_FILES.action_selected()
'
);
tr
=
document
.
createElement
(
'
tr
'
);
tbody
.
appendChild
(
tr
);
tr
.
className
=
'
utilrow
'
;
td
=
document
.
createElement
(
'
td
'
);
tr
.
appendChild
(
td
);
td
.
className
=
'
upload
'
;
td
.
setAttribute
(
'
colspan
'
,
'
6
'
);
button
=
document
.
createElement
(
'
input
'
);
td
.
appendChild
(
button
);
button
.
setAttribute
(
'
type
'
,
'
button
'
);
button
.
setAttribute
(
'
value
'
,
'
Download
'
);
button
.
setAttribute
(
'
onclick
'
,
'
OC_FILES.downloadSelected()
'
);
this
.
showuploader
(
dir
,
td
,
content
[
'
max_upload
'
]);
contentNode
.
appendChild
(
files
);
}
...
...
@@ -344,8 +378,8 @@ OC_FILES.remove_callback=function(req){
}
OC_FILES
.
getSelected
=
function
(){
nodes
=
document
.
getElementsByName
(
'
fileSelector
'
);
files
=
Array
();
var
nodes
=
document
.
getElementsByName
(
'
fileSelector
'
);
var
files
=
Array
();
for
(
index
in
nodes
){
if
(
nodes
[
index
].
checked
){
files
[
files
.
length
]
=
nodes
[
index
].
value
;
...
...
@@ -354,9 +388,31 @@ OC_FILES.getSelected=function(){
return
files
;
}
OC_FILES
.
downloadSelected
=
function
(){
OC_FILES
.
selectAll
=
function
(){
var
value
=
document
.
getElementById
(
'
select_all
'
).
checked
;
var
nodes
=
document
.
getElementsByName
(
'
fileSelector
'
);
for
(
index
in
nodes
){
if
(
nodes
[
index
].
value
){
nodes
[
index
].
checked
=
value
;
}
}
}
OC_FILES
.
action_selected
=
function
(){
var
dropdown
=
action
=
document
.
getElementById
(
'
selected_action
'
);
var
action
=
dropdown
.
options
[
dropdown
.
selectedIndex
].
value
;
if
(
OC_FILES
.
actions_selected
[
action
]
&&
OC_FILES
.
actions_selected
[
action
].
call
){
OC_FILES
.
actions_selected
[
action
].
call
(
OC_FILES
);
}
}
OC_FILES
.
actions_selected
=
new
Object
();
OC_FILES
.
actions_selected
.
download
=
function
(){
files
=
OC_FILES
.
getSelected
();
if
(
files
.
length
>
1
){
if
(
files
.
length
==
0
){
return
false
;
}
else
if
(
files
.
length
>
1
){
files
.
join
(
'
;
'
);
}
else
{
files
=
files
[
0
];
...
...
@@ -364,6 +420,13 @@ OC_FILES.downloadSelected=function(){
window
.
location
=
WEBROOT
+
'
/files/get_file.php?dir=
'
+
OC_FILES
.
dir
+
'
&files=
'
+
files
;
}
OC_FILES
.
actions_selected
[
'
delete
'
]
=
function
(){
files
=
OC_FILES
.
getSelected
();
for
(
index
in
files
){
OC_FILES
.
remove
(
OC_FILES
.
dir
,
files
[
index
]);
}
}
sizeFormat
=
function
(
size
){
var
orig
=
size
;
var
steps
=
Array
(
'
B
'
,
'
KiB
'
,
'
MiB
'
,
'
GiB
'
,
'
TiB
'
);
...
...
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