Sha256: 10623f325037334961fd87257d9ec9c1946ca2a91f175465de4eed7bb34d830a
Contents?: true
Size: 1.73 KB
Versions: 34
Compression:
Stored size: 1.73 KB
Contents
#add_photo.modal.fade .modal-dialog .modal-content .modal-header %button.close{ type: 'button', aria_label: 'Close', data: { dismiss: 'modal' } } %span{ aria_hidden: "true" } × %h4.modal-title = t('.add_new_photo') .modal-body %p= t('my_forum.attachments.allowed_extensions', ext: upload_allowed_extensions.join(', ')) = form_for MyForum::Attachment.new, url: attachments_path, multipart: true, remote: true do |f| = f.file_field 'file[]', multiple: true, id: 'attachment_files' #loaded-content .modal-footer %button.btn.btn-default{ type: 'button', aria_label: 'Close', data: { dismiss: 'modal' } } Close :coffee $('#attachment_files').change -> form_data = new FormData() files_count = $('#attachment_files').prop('files').length form_data.append('files[]', $('#attachment_files').prop('files')[c]) for c in [0...files_count] $.ajax({ url: "#{attachments_path}" dataType: 'html' cache: false contentType: false processData: false data: form_data type: 'post', success: (data, textStatus, jqXHR) -> response = $.parseJSON(data) bbcode_attachments = '' bbcode_attachments += ('[attachment=' + id + '] \n') for id in response.attachments text = $('##{textarea}').val() $('##{textarea}').val(text + '\n' + bbcode_attachments + '\n') $('#loaded-content').html('#{t('my_forum.successfull_aploaded')}') $('#add_photo').modal('hide') $('#attachment_files').val('') })
Version data entries
34 entries across 34 versions & 1 rubygems