Commit 81145047 by Dányi Bence

one: js file autoformat

parent 67c189a2
......@@ -70,7 +70,7 @@ $(function() {
});
$('#old-upload').click(function(e) {
e.preventDefault();
$(this).parent().hide().next('div').show();
$(this).parent().hide().parent().find('#old-upload-form').show();
return false;
})
......@@ -197,12 +197,12 @@ $(function() {
}
})
}
self.rename=function(item,e){
self.rename = function(item, e) {
$(e.target).parent().parent().parent().unbind('click');
$(e.target).parent().parent().parent().find('.name').html('<input type="text" value="'+item.originalName+'" />\
$(e.target).parent().parent().parent().find('.name').html('<input type="text" value="' + item.originalName + '" />\
<input type="submit" value="Átnevezés" />');
$(e.target).parent().parent().parent().find('.name input[type=submit]').click(function(){
var newName=$(e.target).parent().parent().parent().find('.name input[type=text]').val();
$(e.target).parent().parent().parent().find('.name input[type=submit]').click(function() {
var newName = $(e.target).parent().parent().parent().find('.name input[type=text]').val();
loadFolder(self.currentPath());
})
}
......@@ -257,7 +257,7 @@ $(function() {
self.uploadURL('/');
loadFolder(self.currentPath());
};
xhr.onerror =function(){
xhr.onerror = function() {
$('.file-upload').removeClass('opened');
$('.file-upload .details').slideUp(700);
$('#upload-zone').show();
......@@ -273,19 +273,19 @@ $(function() {
var complete = (event.loaded / event.total * 100 | 0);
//progress.value = progress.innerHTML = complete;
self.uploadProgress(parseInt(complete) + '%');
var suffix='B KB MB GB'.split(' ');
var l=event.loaded;
var t=event.total;
for(var i=0;l>1024;i++){
l/=1024;
}
l=l.toFixed(1)+' '+suffix[i];
for(var i=0;t>1024;i++){
t/=1024;
}
t=t.toFixed(1)+' '+suffix[i];
if(complete<100) {
$('#upload-progress-text').html('Feltöltés: '+l+'/'+t+' ('+(event.loaded / event.total * 100).toFixed(2)+'%)');
var suffix = 'B KB MB GB'.split(' ');
var l = event.loaded;
var t = event.total;
for(var i = 0; l > 1024; i++) {
l /= 1024;
}
l = l.toFixed(1) + ' ' + suffix[i];
for(var i = 0; t > 1024; i++) {
t /= 1024;
}
t = t.toFixed(1) + ' ' + suffix[i];
if(complete < 100) {
$('#upload-progress-text').html('Feltöltés: ' + l + '/' + t + ' (' + (event.loaded / event.total * 100).toFixed(2) + '%)');
} else {
$('#upload-progress-text').html('Feltöltés: Mindjárt kész...');
}
......
......@@ -86,7 +86,7 @@
<img class="preview" />
</div>
<div style="display: none" id="upload-progress-text" class="upload-zone"></div>
<div style="display: none" class="upload-zone">
<div style="display: none" class="upload-zone" id="old-upload-form">
<form action="/" method="POST" data-bind="attr: {action: uploadURL}" enctype="multipart/form-data">
<input type="file" name="data" />
<input type="submit" value="Feltöltés" />
......
......@@ -102,8 +102,8 @@ def ajax_quota(request):
user = request.user.username
if StoreApi.userexist(user) != True:
estabilish_store_user(user)
#return HttpResponse(json.dumps(StoreApi.requestquota(user)))
return HttpResponse(json.dumps({'Used':20,'Soft':160,'Hard':200}))
return HttpResponse(json.dumps(StoreApi.requestquota(user)))
#return HttpResponse(json.dumps({'Used':20,'Soft':160,'Hard':200}))
@login_required
def ajax_download(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment