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
3e185911
Commit
3e185911
authored
11 years ago
by
Christopher Schäpers
Browse files
Options
Downloads
Patches
Plain Diff
Fix repeating directory names.
Also fix some CSS for Firefox.
parent
fba6681f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/css/styles.css
+1
-1
1 addition, 1 deletion
core/css/styles.css
core/js/oc-dialogs.js
+17
-14
17 additions, 14 deletions
core/js/oc-dialogs.js
with
18 additions
and
15 deletions
core/css/styles.css
+
1
−
1
View file @
3e185911
...
...
@@ -328,7 +328,7 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
/* ---- DIALOGS ---- */
#dirup
{
width
:
4%
;}
#dirtree
{
width
:
9
3
%
;}
#dirtree
{
width
:
9
2
%
;}
#filelist
{
height
:
270px
;
overflow-y
:
auto
;
background-color
:
white
;
width
:
100%
;}
.filepicker_element_selected
{
background-color
:
lightblue
;}
.filepicker_loader
{
height
:
170px
;
width
:
100%
;
background-color
:
#333
;
-ms-filter
:
"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"
;
filter
:
alpha
(
opacity
=
30
);
opacity
:
.3
;
visibility
:
visible
;
position
:
absolute
;
top
:
0
;
left
:
0
;
text-align
:
center
;
padding-top
:
150px
;}
...
...
This diff is collapsed.
Click to expand it.
core/js/oc-dialogs.js
+
17
−
14
View file @
3e185911
...
...
@@ -151,6 +151,12 @@ var OCdialogs = {
$
(
dialog_id
+
'
#dirtree
'
).
focus
().
change
(
{
dcid
:
dialog_id
},
OCdialogs
.
handleTreeListSelect
);
$
(
dialog_id
+
'
#dirup
'
).
click
(
{
dcid
:
dialog_id
},
OCdialogs
.
filepickerDirUp
);
$
(
dialog_id
+
'
#filelist
'
).
click
(
'
[data="file"]
'
,
function
()
{
OCdialogs
.
handlePickerClick
(
this
,
$
(
this
).
data
(
'
entryname
'
),
$
(
this
).
data
(
'
dcid
'
));
});
$
(
dialog_id
+
'
#filelist
'
).
on
(
'
click
'
,
'
[data="dir"]
'
,
function
()
{
OCdialogs
.
handlePickerClick
(
this
,
$
(
this
).
data
(
'
entryname
'
),
$
(
this
).
data
(
'
dcid
'
));
});
$
(
dialog_id
).
ready
(
function
(){
$
.
getJSON
(
OC
.
filePath
(
'
files
'
,
'
ajax
'
,
'
rawlist.php
'
),
{
mimetype
:
mimetype_filter
}
,
function
(
request
)
{
...
...
@@ -310,12 +316,7 @@ var OCdialogs = {
files
+=
template
.
replace
(
'
*LASTMODDATE*
'
,
OC
.
mtime2date
(
sorted
[
i
].
mtime
)).
replace
(
'
*NAME*
'
,
escapeHTML
(
sorted
[
i
].
name
)).
replace
(
'
*MIMETYPEICON*
'
,
sorted
[
i
].
mimetype_icon
).
replace
(
'
*ENTRYNAME*
'
,
escapeHTML
(
sorted
[
i
].
name
)).
replace
(
'
*ENTRYTYPE*
'
,
escapeHTML
(
sorted
[
i
].
type
));
}
$
(
dialog_content_id
+
'
#filelist
'
).
html
(
files
).
on
(
'
click
'
,
'
[data="file"]
'
,
function
()
{
OCdialogs
.
handlePickerClick
(
this
,
$
(
this
).
data
(
'
entryname
'
),
$
(
this
).
data
(
'
dcid
'
));
});
$
(
dialog_content_id
+
'
#filelist
'
).
html
(
files
).
on
(
'
click
'
,
'
[data="dir"]
'
,
function
()
{
OCdialogs
.
handlePickerClick
(
this
,
$
(
this
).
data
(
'
entryname
'
),
$
(
this
).
data
(
'
dcid
'
));
});
$
(
dialog_content_id
+
'
#filelist
'
).
html
(
files
);
$
(
dialog_content_id
+
'
.filepicker_loader
'
).
css
(
'
visibility
'
,
'
hidden
'
);
},
/**
...
...
@@ -334,9 +335,10 @@ var OCdialogs = {
$
(
dialog_id
+
'
#dirtree
'
).
html
(
paths
);
},
/**
* handle selection made in the tree list
*/
handleTreeListSelect
:
function
(
event
)
{
// fails at paths with &
if
(
$
(
"
option:selected
"
,
this
).
html
().
indexOf
(
'
/
'
)
!==
-
1
)
{
// if there's a slash in the selected path, don't append it
$
(
event
.
data
.
dcid
).
data
(
'
path
'
,
$
(
"
option:selected
"
,
this
).
html
());
}
else
{
...
...
@@ -360,7 +362,9 @@ var OCdialogs = {
function
(
request
)
{
OCdialogs
.
fillTreeList
(
request
,
event
.
data
.
dcid
)
}
);
},
// go one directory up
/**
* go one directory up
*/
filepickerDirUp
:
function
(
event
)
{
var
old_path
=
$
(
event
.
data
.
dcid
).
data
(
'
path
'
);
if
(
old_path
!==
"
/
"
)
{
...
...
@@ -388,11 +392,10 @@ var OCdialogs = {
);
}
},
// this function is in early development state, please dont use it unless you know what you are doing
/**
* handle clicks made in the filepicker
*/
handlePickerClick
:
function
(
element
,
name
,
dialog_content_id
)
{
var
datapath
=
$
(
dialog_content_id
).
data
(
'
path
'
);
if
(
datapath
===
undefined
)
{
datapath
=
''
};
datapath
+=
name
;
if
(
$
(
element
).
attr
(
'
data
'
)
===
'
file
'
){
if
(
$
(
dialog_content_id
).
data
(
'
multiselect
'
)
!==
true
)
{
$
(
dialog_content_id
+
'
.filepicker_element_selected
'
).
removeClass
(
'
filepicker_element_selected
'
);
...
...
@@ -400,7 +403,7 @@ var OCdialogs = {
$
(
element
).
toggleClass
(
'
filepicker_element_selected
'
);
return
;
}
else
if
(
$
(
element
).
attr
(
'
data
'
)
===
'
dir
'
)
{
datapath
+
=
'
/
'
;
var
datapath
=
escapeHTML
(
$
(
dialog_content_id
).
data
(
'
path
'
)
+
name
+
'
/
'
)
;
$
(
dialog_content_id
).
data
(
'
path
'
,
datapath
);
$
(
dialog_content_id
+
'
.filepicker_loader
'
).
css
(
'
visibility
'
,
'
visible
'
);
$
.
getJSON
(
...
...
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