|
|
|
@ -15,7 +15,7 @@ function postUpMsg(attachmentId)
|
|
|
|
|
|
|
|
|
|
function reload(fileSpan) {
|
|
|
|
|
fileSpan.remove();
|
|
|
|
|
$('#upload_file_count').html("未上传文件");
|
|
|
|
|
$('#upload_file_count').html("<%= l(:label_no_file_uploaded)%>");
|
|
|
|
|
$old_file = $("#_file");
|
|
|
|
|
$new_file = $old_file.clone(true);
|
|
|
|
|
$old_file.replaceWith($new_file);
|
|
|
|
@ -37,7 +37,7 @@ function addFile(inputEl, file, eagerUpload) {
|
|
|
|
|
$('<span >'+$(inputEl).data('fieldIsPublic')+':</span>').attr({ 'class': 'ispublic-label' }) ,
|
|
|
|
|
$('<input>', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload),
|
|
|
|
|
$('<a> </a>').attr({ 'href': "#", 'class': 'remove-upload' }).click(function(){
|
|
|
|
|
if(confirm('您确定要删除吗?')){
|
|
|
|
|
if(confirm($(inputEl).data('areYouSure'))){
|
|
|
|
|
removeFile();
|
|
|
|
|
if(!eagerUpload){
|
|
|
|
|
(function(e){
|
|
|
|
@ -107,7 +107,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|
|
|
|
//gcm files count and add delete_all link
|
|
|
|
|
|
|
|
|
|
var count=$('#attachments_fields>span').length;
|
|
|
|
|
$('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+"个文件已上传");
|
|
|
|
|
$('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+$(inputEl).data('fileCount'));
|
|
|
|
|
if(count>=1){
|
|
|
|
|
var add_attachs=$('.add_attachment');
|
|
|
|
|
var delete_all=$('.remove_all');
|
|
|
|
@ -141,7 +141,7 @@ function removeFile() {
|
|
|
|
|
|
|
|
|
|
//gcm delete all file
|
|
|
|
|
function removeAll(){
|
|
|
|
|
if(confirm("您确定要删除所有文件吗")){
|
|
|
|
|
if(confirm($(inputEl).data('deleteAllFiles'))){
|
|
|
|
|
$(".remove-upload").removeAttr("data-confirm");
|
|
|
|
|
$(".remove-upload").click();
|
|
|
|
|
}
|
|
|
|
@ -196,7 +196,7 @@ function addInputFiles(inputEl) {
|
|
|
|
|
attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false);
|
|
|
|
|
if (attachmentId) {
|
|
|
|
|
$(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]'}).hide();
|
|
|
|
|
$('#upload_file_count').html("已上传"+"<span id=\"count\">"+1+"</span>"+"个文件");
|
|
|
|
|
$('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+$(inputEl).data('fileCount'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|