Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8fce52f8
authored
Mar 01, 2016
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pretty print file size
1 parent
572e87c9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
app/index.html
app/js/app.js
app/js/filesize.min.js
app/index.html
View file @
8fce52f
...
...
@@ -141,7 +141,7 @@
<img
v-bind:src=
"entry.previewUrl"
height=
"48px"
width=
"48px"
/>
</th>
<th>
{{ entry.filePath }}
</th>
<th>
{{ entry.size }}
</th>
<th>
{{ entry.size
| prettyFileSize
}}
</th>
<th><span
v-my-tooltip=
"foobar"
data-toggle=
"tooltip"
title=
"{{ entry.mtime }}"
>
{{ entry.mtime | prettyDate }}
</span></th>
<th
style=
"text-align: right;"
><button
class=
"btn btn-sm btn-danger"
v-on:click
.
stop=
"delAsk(entry)"
><i
class=
"fa fa-trash"
></i></button></th>
</tr>
...
...
@@ -157,6 +157,7 @@
<script
src=
"/_admin/js/jquery-1.12.1.min.js"
></script>
<script
src=
"/_admin/js/bootstrap.min.js"
></script>
<script
src=
"/_admin/js/vue.min.js"
></script>
<script
src=
"/_admin/js/filesize.min.js"
></script>
<script
src=
"/_admin/js/superagent.js"
></script>
<script
src=
"/_admin/js/app.js"
></script>
...
...
app/js/app.js
View file @
8fce52f
...
...
@@ -185,6 +185,10 @@ Vue.filter('prettyDate', function (value) {
return
d
.
toDateString
();
});
Vue
.
filter
(
'prettyFileSize'
,
function
(
value
)
{
return
filesize
(
value
);
});
var
app
=
new
Vue
({
el
:
'#app'
,
data
:
{
...
...
app/js/filesize.min.js
0 → 100644
View file @
8fce52f
/*
2016
@version 3.2.1
*/
"use strict"
;
!
function
(
a
){
function
b
(
a
){
var
b
=
arguments
.
length
<=
1
||
void
0
===
arguments
[
1
]?{}:
arguments
[
1
],
e
=
[],
f
=
0
,
g
=
void
0
,
h
=
void
0
,
i
=
void
0
,
j
=
void
0
,
k
=
void
0
,
l
=
void
0
,
m
=
void
0
,
n
=
void
0
,
o
=
void
0
,
p
=
void
0
,
q
=
void
0
;
if
(
isNaN
(
a
))
throw
new
Error
(
"Invalid arguments"
);
return
i
=
b
.
bits
===!
0
,
o
=
b
.
unix
===!
0
,
h
=
b
.
base
||
2
,
n
=
void
0
!==
b
.
round
?
b
.
round
:
o
?
1
:
2
,
p
=
void
0
!==
b
.
spacer
?
b
.
spacer
:
o
?
""
:
" "
,
q
=
b
.
symbols
||
b
.
suffixes
||
{},
m
=
b
.
output
||
"string"
,
g
=
void
0
!==
b
.
exponent
?
b
.
exponent
:
-
1
,
l
=
Number
(
a
),
k
=
0
>
l
,
j
=
h
>
2
?
1
e3
:
1024
,
k
&&
(
l
=-
l
),
0
===
l
?(
e
[
0
]
=
0
,
e
[
1
]
=
o
?
""
:
i
?
"b"
:
"B"
):((
-
1
===
g
||
isNaN
(
g
))
&&
(
g
=
Math
.
floor
(
Math
.
log
(
l
)
/
Math
.
log
(
j
)),
0
>
g
&&
(
g
=
0
)),
g
>
8
&&
(
g
=
8
),
f
=
2
===
h
?
l
/
Math
.
pow
(
2
,
10
*
g
):
l
/
Math
.
pow
(
1
e3
,
g
),
i
&&
(
f
=
8
*
f
,
f
>
j
&&
8
>
g
&&
(
f
/=
j
,
g
++
)),
e
[
0
]
=
Number
(
f
.
toFixed
(
g
>
0
?
n
:
0
)),
e
[
1
]
=
10
===
h
&&
1
===
g
?
i
?
"kb"
:
"kB"
:
d
[
i
?
"bits"
:
"bytes"
][
g
],
o
&&
(
e
[
1
]
=
e
[
1
].
charAt
(
0
),
c
.
test
(
e
[
1
])
&&
(
e
[
0
]
=
Math
.
floor
(
e
[
0
]),
e
[
1
]
=
""
))),
k
&&
(
e
[
0
]
=-
e
[
0
]),
e
[
1
]
=
q
[
e
[
1
]]
||
e
[
1
],
"array"
===
m
?
e
:
"exponent"
===
m
?
g
:
"object"
===
m
?{
value
:
e
[
0
],
suffix
:
e
[
1
],
symbol
:
e
[
1
]}:
e
.
join
(
p
)}
var
c
=
/^
(
b|B
)
$/
,
d
=
{
bits
:[
"b"
,
"Kb"
,
"Mb"
,
"Gb"
,
"Tb"
,
"Pb"
,
"Eb"
,
"Zb"
,
"Yb"
],
bytes
:[
"B"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
,
"EB"
,
"ZB"
,
"YB"
]};
"undefined"
!=
typeof
exports
?
module
.
exports
=
b
:
"function"
==
typeof
define
&&
define
.
amd
?
define
(
function
(){
return
b
}):
a
.
filesize
=
b
}(
"undefined"
!=
typeof
window
?
window
:
global
);
//# sourceMappingURL=filesize.min.js.map
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment