v1.0.0 RC 1
This commit is contained in:
75
jquery/fileuploader.js
vendored
75
jquery/fileuploader.js
vendored
@@ -498,19 +498,20 @@ qq.FileUploader = function(o){
|
||||
((typeof o.addSlideText !== 'undefined')?o.addSlideText:'Glisser les images ici') +
|
||||
'</span>' +
|
||||
'</div>' +
|
||||
'<span class="uploader_button button add round">'+
|
||||
((typeof o.addFileText !== 'undefined')?o.addFileText:'Ajouter une image') +
|
||||
'</span>' +
|
||||
'<a class="uploader_button button round"><i class="icon fa fa-c-add"></i>'+
|
||||
((typeof o.addFileText !== 'undefined')?o.addFileText:'Ajouter une image') +
|
||||
'</a>' +
|
||||
'<div class="uploader_buffer"></div>' +
|
||||
'<ul id="uploader_list" class="uploader_list"></ul>' +
|
||||
'</div>',
|
||||
|
||||
// template for one item in file list
|
||||
fileTemplate:'<li id="uploader_item">' +
|
||||
'<span class="uploader_item_loading"></span>' +
|
||||
'<i class="fa fa-inline fa-c-doc"></i>' +
|
||||
'<span class="uploader_item_loading"><i class="fa fa-spin fa-c-loading"></i></span>' +
|
||||
'<span class="uploader_item_file"></span>' +
|
||||
'<span class="uploader_item_size"></span>' +
|
||||
'<a class="uploader_item_cancel" href="#">Annuler</a>' +
|
||||
'<a class="uploader_item_cancel" href="#"><i class="fa fa-60 fa-c-delete"></i></a>' +
|
||||
'<span class="uploader_item_failed_notice">Echoué</span>' +
|
||||
'</li>',
|
||||
|
||||
@@ -853,7 +854,8 @@ qq.UploadButton.prototype = {
|
||||
// in Opera only 'browse' button
|
||||
// is clickable and it is located at
|
||||
// the right side of the input
|
||||
left: '-297px',
|
||||
//left: '-297px',
|
||||
left: '-2px',
|
||||
top: '-2px',
|
||||
width:'auto',
|
||||
fontFamily: 'Arial',
|
||||
@@ -1307,4 +1309,63 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
|
||||
this._xhrs[id] = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function addImage(stepId, imageId, imageName, imageDesc)
|
||||
{
|
||||
//get image number
|
||||
var $ImageBox = databap.getMainElem('#'+databap.getElemTag('uploader_item', [stepId, imageId]));
|
||||
|
||||
//Create new image
|
||||
var $newImage = $([ '<span id="image_action" class="image_action">',
|
||||
'<input type="text" id="image_desc" name="image_desc" class="image_description round" />',
|
||||
'<input type="hidden" name="image_name" id="image_name" value="" />',
|
||||
'<span id="delete_image" class="clickable"><i class="fa fa-60 fa-c-delete"></i></span>',
|
||||
'</span>'].join('\n'));
|
||||
|
||||
//Update doc icon
|
||||
var sExt = imageName.slice(imageName.lastIndexOf('.') + 1);
|
||||
$ImageBox.find('.fa').eq(0).addClass('fa-c-file-'+sExt);
|
||||
|
||||
//Set image name
|
||||
$newImage.find('#image_name').val(imageName);
|
||||
|
||||
//Set image description
|
||||
$newImage.find('#image_desc').val(imageDesc);
|
||||
|
||||
//delete button for this image
|
||||
$newImage.find('#delete_image').click
|
||||
(
|
||||
function()
|
||||
{
|
||||
var stepIds = databap.getElemIds($(this).attr('id'));
|
||||
removeImage(stepIds[0], stepIds[1]);
|
||||
}
|
||||
);
|
||||
|
||||
//Add ids
|
||||
$newImage = databap.setElemTags($newImage, [stepId, imageId]);
|
||||
|
||||
//Add Image to the step
|
||||
$newImage.appendTo($ImageBox);
|
||||
|
||||
//Block exit
|
||||
databap.tmp('started', true);
|
||||
|
||||
databap.updateScrollBar();
|
||||
|
||||
return imageId;
|
||||
}
|
||||
|
||||
function removeImage(iStepId, iImageId)
|
||||
{
|
||||
var sImageTag = databap.getElemTag('uploader_item', [iStepId, iImageId]);
|
||||
databap.getMainElem('#'+sImageTag).hide
|
||||
(
|
||||
'fast',
|
||||
function()
|
||||
{
|
||||
$(this).remove();
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user