Change messages about file types in the comment form.

This commit is contained in:
Yota Ichino
2015-10-25 22:56:31 +09:00
parent c8822cb4ca
commit c6a4c13394

View File

@@ -3,7 +3,7 @@
@import gitbucket.core.util.FileUtil @import gitbucket.core.util.FileUtil
<div class="muted attachable"> <div class="muted attachable">
@textarea @textarea
<div class="clickable">Attach images or PDF files by dragging &amp; dropping, or selecting them.</div> <div class="clickable">Attach images or documents by dragging &amp; dropping, or selecting them.</div>
</div> </div>
@defining("(id=\")([\\w\\-]*)(\")".r.findFirstMatchIn(textarea.body).map(_.group(2))){ textareaId => @defining("(id=\")([\\w\\-]*)(\")".r.findFirstMatchIn(textarea.body).map(_.group(2))){ textareaId =>
<script> <script>
@@ -13,8 +13,8 @@ $(function(){
url: '@path/upload/file/@owner/@repository', url: '@path/upload/file/@owner/@repository',
maxFilesize: 10, maxFilesize: 10,
acceptedFiles: @Html(FileUtil.mimeTypeWhiteList.mkString("'", ",", "'")), acceptedFiles: @Html(FileUtil.mimeTypeWhiteList.mkString("'", ",", "'")),
dictInvalidFileType: 'Unfortunately, we don\'t support that file type. Try again with a PNG, GIF, or JPG.', dictInvalidFileType: 'Unfortunately, we don\'t support that file type. Try again with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, or PDF.',
previewTemplate: "<div class=\"dz-preview\">\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress>Uploading your images or PDF files...</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>", previewTemplate: "<div class=\"dz-preview\">\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress>Uploading your files...</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>",
success: function(file, id) { success: function(file, id) {
var attachFile = (file.type.match(/image\/.*/) ? '\n![' + file.name.split('.')[0] : '\n[' + file.name) + var attachFile = (file.type.match(/image\/.*/) ? '\n![' + file.name.split('.')[0] : '\n[' + file.name) +
'](@baseUrl/@owner/@repository/_attached/' + id + ')'; '](@baseUrl/@owner/@repository/_attached/' + id + ')';