mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 09:43:41 +00:00
Fix wrong intends in js_upload
This commit is contained in:
parent
dcf4b5695d
commit
e0815309d0
1 changed files with 21 additions and 21 deletions
|
@ -65,13 +65,13 @@ function getSelected(opt) {
|
||||||
var selected = new Array();
|
var selected = new Array();
|
||||||
var index = 0;
|
var index = 0;
|
||||||
for (var intLoop = 0; intLoop < opt.length; intLoop++) {
|
for (var intLoop = 0; intLoop < opt.length; intLoop++) {
|
||||||
if ((opt[intLoop].selected) ||
|
if ((opt[intLoop].selected) ||
|
||||||
(opt[intLoop].checked)) {
|
(opt[intLoop].checked)) {
|
||||||
index = selected.length;
|
index = selected.length;
|
||||||
//selected[index] = new Object;
|
//selected[index] = new Object;
|
||||||
selected[index] = opt[intLoop].value;
|
selected[index] = opt[intLoop].value;
|
||||||
//selected[index] = intLoop;
|
//selected[index] = intLoop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
|
@ -106,22 +106,22 @@ function createUploader() {
|
||||||
|
|
||||||
if (typeof acl != "undefined"){
|
if (typeof acl != "undefined"){
|
||||||
uploader.setParams( {
|
uploader.setParams( {
|
||||||
newalbum : newalbum,
|
newalbum : newalbum,
|
||||||
album : album,
|
album : album,
|
||||||
not_visible : document.getElementById('photos-upload-noshare').checked,
|
not_visible : document.getElementById('photos-upload-noshare').checked,
|
||||||
group_allow : acl.allow_gid.join(','),
|
group_allow : acl.allow_gid.join(','),
|
||||||
contact_allow : acl.allow_cid.join(','),
|
contact_allow : acl.allow_cid.join(','),
|
||||||
group_deny : acl.deny_gid.join(','),
|
group_deny : acl.deny_gid.join(','),
|
||||||
contact_deny : acl.deny_cid.join(',')
|
contact_deny : acl.deny_cid.join(',')
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uploader.setParams( {
|
uploader.setParams( {
|
||||||
newalbum : newalbum,
|
newalbum : newalbum,
|
||||||
album : album,
|
album : album,
|
||||||
not_visible : document.getElementById('photos-upload-noshare').checked,
|
not_visible : document.getElementById('photos-upload-noshare').checked,
|
||||||
group_allow : getSelected(document.getElementById('group_allow')).join(','),
|
group_allow : getSelected(document.getElementById('group_allow')).join(','),
|
||||||
contact_allow : getSelected(document.getElementById('contact_allow')).join(','),
|
contact_allow : getSelected(document.getElementById('contact_allow')).join(','),
|
||||||
group_deny : getSelected(document.getElementById('group_deny')).join(','),
|
group_deny : getSelected(document.getElementById('group_deny')).join(','),
|
||||||
contact_deny : getSelected(document.getElementById('contact_deny')).join(',')
|
contact_deny : getSelected(document.getElementById('contact_deny')).join(',')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -174,9 +174,9 @@ function js_upload_post_file(&$a,&$b) {
|
||||||
|
|
||||||
$result = $a->data['upload_result'];
|
$result = $a->data['upload_result'];
|
||||||
|
|
||||||
$b['src'] = $result['path'];
|
$b['src'] = $result['path'];
|
||||||
$b['filename'] = $result['filename'];
|
$b['filename'] = $result['filename'];
|
||||||
$b['filesize'] = filesize($b['src']);
|
$b['filesize'] = filesize($b['src']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ class qqFileUploader {
|
||||||
*/
|
*/
|
||||||
function handleUpload(){
|
function handleUpload(){
|
||||||
|
|
||||||
if (!$this->file){
|
if (!$this->file) {
|
||||||
return ['error' => L10n::t('No files were uploaded.')];
|
return ['error' => L10n::t('No files were uploaded.')];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,14 +346,14 @@ class qqFileUploader {
|
||||||
|
|
||||||
if ($this->file->save()){
|
if ($this->file->save()){
|
||||||
return [
|
return [
|
||||||
'success'=>true,
|
'success' => true,
|
||||||
'path' => $this->file->getPath(),
|
'path' => $this->file->getPath(),
|
||||||
'filename' => $filename . '.' . $ext
|
'filename' => $filename . '.' . $ext
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
return [
|
return [
|
||||||
'error'=> L10n::t('Upload was cancelled, or server error encountered'),
|
'error' => L10n::t('Upload was cancelled, or server error encountered'),
|
||||||
'path' => $this->file->getPath(),
|
'path' => $this->file->getPath(),
|
||||||
'filename' => $filename . '.' . $ext
|
'filename' => $filename . '.' . $ext
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue