@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo, completionContext: String, generateScript: Boolean = true)(textarea: Html)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.util.FileUtil @import gitbucket.core.view.helpers
@textarea
Attach images or documents by dragging & dropping, or selecting them.
@defining("(id=\")([\\w\\-]*)(\")".r.findFirstMatchIn(textarea.body).map(_.group(2))){ textareaId =>
} @dropzone(clickable: Boolean, textareaId: Option[String]) = { url: '@context.path/upload/file/@repository.owner/@repository.name', maxFilesize: @{context.settings.upload.maxFileSize / 1024 / 1024}, timeout: @{context.settings.upload.timeout}, clickable: @clickable, previewTemplate: "
\n
Uploading your files...
\n
\n
", success: function(file, id) { var attachFile = (file.type.match(/image\/.*/) ? '\n![' + file.name.split('.')[0] : '\n[' + file.name) + '](@context.baseUrl/@repository.owner/@repository.name/_attached/' + id + ')'; $('#@textareaId').val($('#@textareaId').val() + attachFile); $(file.previewElement).prevAll('div.dz-preview').addBack().remove(); } }