1
0
Fork 0

Upload/Browse popup for files and images

Jot buttons to upload images and files show a popup, where the
user can select a previously uploaded item o upload a new one
This commit is contained in:
Fabrixxm 2015-07-28 17:20:40 +02:00
commit 70b7de39a7
11 changed files with 422 additions and 38 deletions

View file

@ -127,38 +127,67 @@ function enableOnUser(){
<script>
var ispublic = '{{$ispublic}}';
$(document).ready(function() {
/* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser);
var uploader = new window.AjaxUpload(
'wall-image-upload',
{ action: 'wall_upload/{{$nickname}}',
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
addeditortext(response);
$('#profile-rotator').hide();
}
}
);
var file_uploader = new window.AjaxUpload(
'wall-file-upload',
{ action: 'wall_attach/{{$nickname}}',
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
addeditortext(response);
$('#profile-rotator').hide();
}
}
);
/* show images / file browser window
*
**/
/* callback */
$('body').on('fbrowser.image', function(e, filename, embedcode) {
$.colorbox.close();
addeditortext(embedcode);
});
$('body').on('fbrowser.file', function(e, filename, embedcode) {
$.colorbox.close();
addeditortext(embedcode);
});
$('#wall-image-upload').on('click', function(){
$.colorbox({href: baseurl + "/fbrowser/image/?mode=minimal", iframe:true,innerWidth:'500px',innerHeight:'400px'})
});
$('#wall-file-upload').on('click', function(){
$.colorbox({href: baseurl + "/fbrowser/file/?mode=minimal", iframe:true,innerWidth:'500px',innerHeight:'400px'})
});
/**
var uploader = new window.AjaxUpload(
'wall-image-upload',
{ action: 'wall_upload/{{$nickname}}',
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
addeditortext(response);
$('#profile-rotator').hide();
}
}
);
var file_uploader = new window.AjaxUpload(
'wall-file-upload',
{ action: 'wall_attach/{{$nickname}}',
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
addeditortext(response);
$('#profile-rotator').hide();
}
}
);
}
**/
});
function deleteCheckedItems() {
if(confirm('{{$delitems}}')) {
var checkedstr = '';