Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
02ccb9af
authored
Feb 06, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: all files are displayed by default
parent
77a16324
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
61 deletions
+2
-61
one/static/cloud.js
+2
-53
one/templates/box-filelist.html
+0
-8
No files found.
one/static/cloud.js
View file @
02ccb9af
...
...
@@ -38,15 +38,6 @@ $(function() {
}
$
(
'.wm .summary'
).
unbind
(
'click'
).
click
(
toggleDetails
);
$
(
'#load-more-files'
).
click
(
function
()
{
$
(
'.actions'
,
this
).
show
();
var
that
=
this
;
setTimeout
(
function
()
{
$
(
that
).
prev
(
'li'
).
slideDown
(
500
,
function
()
{
$
(
'.actions'
,
that
).
hide
();
});
},
2000
);
})
$
(
'#new-wm-button'
).
click
(
function
()
{
$
(
'#modal'
).
show
();
$
(
'#modal-container'
).
html
(
$
(
'#new-wm'
).
html
());
...
...
@@ -106,12 +97,8 @@ $(function() {
var
uploadURLRequestInProgress
=
false
;
//currently displayed files
self
.
files
=
ko
.
observableArray
();
//all fetched files
self
.
allFiles
=
[];
//false, if you are in /
self
.
notInRoot
=
ko
.
observable
(
false
);
//default file limit
self
.
fileLimit
=
5
;
//defalut path to display
self
.
currentPath
=
ko
.
observable
(
'/'
);
//default upload url (invalid)
...
...
@@ -142,7 +129,6 @@ $(function() {
$
(
'#current-location select'
).
on
(
'change'
,
function
()
{
self
.
sortBy
(
$
(
'#current-location select'
).
val
());
sortOriginalFiles
();
sortFiles
();
})
...
...
@@ -217,28 +203,6 @@ $(function() {
}
}[
self
.
sortBy
()]);
}
var
sortOriginalFiles
=
function
()
{
self
.
allFiles
.
sort
({
name
:
function
(
a
,
b
)
{
if
(
a
.
TYPE
===
b
.
TYPE
)
{
return
a
.
NAME
.
localeCompare
(
b
.
NAME
);
}
if
(
a
.
TYPE
===
'F'
)
{
return
1
;
}
return
-
1
;
},
date
:
function
(
a
,
b
)
{
if
(
a
.
TYPE
===
b
.
TYPE
)
{
return
new
Date
(
b
.
MTIME
).
getTime
()
-
new
Date
(
a
.
MTIME
).
getTime
();
}
if
(
a
.
TYPE
===
'F'
)
{
return
1
;
}
return
-
1
;
}
}[
self
.
sortBy
()]);
}
/**
* Loads the specified folder
...
...
@@ -279,11 +243,8 @@ $(function() {
var
added
=
0
;
self
.
notInRoot
(
self
.
currentPath
().
lastIndexOf
(
'/'
)
!==
0
);
self
.
files
([]);
self
.
allFiles
=
data
;
sortOriginalFiles
();
for
(
var
i
in
self
.
allFiles
)
{
added
++
;
if
(
added
<
6
)
addFile
(
self
.
allFiles
[
i
]);
for
(
var
i
in
data
)
{
addFile
(
data
[
i
]);
}
sortFiles
();
}
...
...
@@ -330,18 +291,6 @@ $(function() {
}
/**
* Shows 5 more files (in the current folder)
*/
self
.
showMore
=
function
()
{
for
(
var
i
=
self
.
fileLimit
;
i
<
self
.
fileLimit
+
5
;
i
++
)
{
if
(
self
.
allFiles
[
i
]
===
undefined
)
break
;
addFile
(
self
.
allFiles
[
i
]);
}
self
.
fileLimit
+=
5
;
sortFiles
();
}
/**
* Downloads the specified file (or folder zipped)
*/
self
.
download
=
function
(
item
)
{
...
...
one/templates/box-filelist.html
View file @
02ccb9af
...
...
@@ -65,14 +65,6 @@
<!-- /ko -->
</ul>
<ul
class=
"file-list"
>
<li
class=
"file-details wm small-row"
id=
"load-more-files"
data-bind=
"visible: (files().length>0 && files().length != allFiles.length)"
>
<div
class=
"summary"
data-bind=
"click: showMore"
>
<div
class=
"name filetype-more"
>
{% trans "Show more files…" %} (
<span
data-bind=
"text: allFiles.length-files().length"
></span>
{% trans "hidden" context "is" %})
</div>
<div
class=
"clear"
></div>
</div>
</li>
<li
class=
"wm small-row"
>
<div
class=
"summary"
id=
"new-folder"
>
<div
class=
"name filetype-new-folder"
>
{% trans "Create folder" %}
</div>
...
...
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