Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c49a6319
authored
Feb 19, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: fix module pattern
parent
2351ab14
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
one/static/script/store.js
+7
-6
one/static/script/util.js
+1
-0
No files found.
one/static/script/store.js
View file @
c49a6319
...
@@ -83,7 +83,7 @@ var cloud = (function(cloud) {
...
@@ -83,7 +83,7 @@ var cloud = (function(cloud) {
/**
/**
* Loads the specified folder
* Loads the specified folder
*/
*/
var
loadFolder
=
throttle
(
function
(
path
,
fast
)
{
var
loadFolder
=
cloud
.
throttle
(
function
(
path
,
fast
)
{
self
.
currentPath
(
path
);
self
.
currentPath
(
path
);
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
...
@@ -113,7 +113,7 @@ var cloud = (function(cloud) {
...
@@ -113,7 +113,7 @@ var cloud = (function(cloud) {
})
})
});
});
self
.
loadTopList
=
throttle
(
function
()
{
self
.
loadTopList
=
cloud
.
throttle
(
function
()
{
self
.
currentPath
(
'/'
);
self
.
currentPath
(
'/'
);
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
...
@@ -201,7 +201,7 @@ var cloud = (function(cloud) {
...
@@ -201,7 +201,7 @@ var cloud = (function(cloud) {
originalName
:
d
.
NAME
,
originalName
:
d
.
NAME
,
originalSize
:
d
.
SIZE
,
originalSize
:
d
.
SIZE
,
name
:
d
.
NAME
.
length
>
30
?
(
d
.
NAME
.
substr
(
0
,
20
)
+
'... ('
+
extension
+
')'
)
:
d
.
NAME
,
name
:
d
.
NAME
.
length
>
30
?
(
d
.
NAME
.
substr
(
0
,
20
)
+
'... ('
+
extension
+
')'
)
:
d
.
NAME
,
size
:
convert
(
d
.
SIZE
),
size
:
c
loud
.
c
onvert
(
d
.
SIZE
),
type
:
gettext
(
'file'
),
type
:
gettext
(
'file'
),
mTime
:
d
.
MTIME
,
mTime
:
d
.
MTIME
,
getTypeClass
:
'name filetype-'
+
type
,
getTypeClass
:
'name filetype-'
+
type
,
...
@@ -341,7 +341,7 @@ var cloud = (function(cloud) {
...
@@ -341,7 +341,7 @@ var cloud = (function(cloud) {
/**
/**
* Creates a new folder (and then reloads the current folder)
* Creates a new folder (and then reloads the current folder)
*/
*/
self
.
newFolder
=
throttle
(
function
(
i
,
e
)
{
self
.
newFolder
=
cloud
.
throttle
(
function
(
i
,
e
)
{
$
(
e
.
target
).
parent
().
parent
().
parent
().
removeClass
(
'opened'
);
$
(
e
.
target
).
parent
().
parent
().
parent
().
removeClass
(
'opened'
);
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
...
@@ -367,7 +367,7 @@ var cloud = (function(cloud) {
...
@@ -367,7 +367,7 @@ var cloud = (function(cloud) {
/**
/**
* Uploads the specified file(s)
* Uploads the specified file(s)
*/
*/
var
readfiles
=
delayUntil
(
function
(
file
)
{
var
readfiles
=
cloud
.
delayUntil
(
function
(
file
)
{
//1 GB file limit
//1 GB file limit
if
(
file
.
size
>
1024
*
1024
*
1024
)
{
if
(
file
.
size
>
1024
*
1024
*
1024
)
{
$
(
'#upload-zone'
).
hide
();
$
(
'#upload-zone'
).
hide
();
...
@@ -419,7 +419,7 @@ var cloud = (function(cloud) {
...
@@ -419,7 +419,7 @@ var cloud = (function(cloud) {
t
=
t
.
toFixed
(
1
)
+
' '
+
suffix
[
i
];
t
=
t
.
toFixed
(
1
)
+
' '
+
suffix
[
i
];
var
diff
=
new
Date
().
getTime
()
-
start
;
var
diff
=
new
Date
().
getTime
()
-
start
;
if
(
complete
<
100
)
{
if
(
complete
<
100
)
{
$
(
'#upload-progress-text'
).
html
(
gettext
(
'Upload'
)
+
': '
+
convert
(
event
.
loaded
/
diff
*
1000
)
+
'/s ('
+
(
event
.
loaded
/
event
.
total
*
100
).
toFixed
(
2
)
+
'%)'
);
$
(
'#upload-progress-text'
).
html
(
gettext
(
'Upload'
)
+
': '
+
c
loud
.
c
onvert
(
event
.
loaded
/
diff
*
1000
)
+
'/s ('
+
(
event
.
loaded
/
event
.
total
*
100
).
toFixed
(
2
)
+
'%)'
);
}
else
{
}
else
{
$
(
'#upload-progress-text'
).
html
(
gettext
(
'Upload'
)
+
': '
+
gettext
(
'done, processing...'
));
$
(
'#upload-progress-text'
).
html
(
gettext
(
'Upload'
)
+
': '
+
gettext
(
'done, processing...'
));
}
}
...
@@ -484,4 +484,5 @@ var cloud = (function(cloud) {
...
@@ -484,4 +484,5 @@ var cloud = (function(cloud) {
e
.
preventDefault
();
e
.
preventDefault
();
return
false
;
return
false
;
});
});
return
cloud
;
})(
cloud
||
{});
})(
cloud
||
{});
one/static/script/util.js
View file @
c49a6319
...
@@ -50,4 +50,5 @@ var cloud = (function(cloud) {
...
@@ -50,4 +50,5 @@ var cloud = (function(cloud) {
check
.
apply
(
null
,
arguments
);
check
.
apply
(
null
,
arguments
);
}
}
}
}
return
cloud
;
})(
cloud
||
{});
})(
cloud
||
{});
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