Commit 81145047 by Dányi Bence

one: js file autoformat

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