From 3878c40e705cfea4db2b10e59d8868f57da403cf Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 29 Dec 2015 20:41:08 +0100 Subject: [PATCH] Improved max length on article text (richtext). --- .../controllers/_ui_element/richtext.coffee | 34 +++++++++---------- .../ticket_zoom/article_new.coffee | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_ui_element/richtext.coffee b/app/assets/javascripts/app/controllers/_ui_element/richtext.coffee index 785fd7b01..9278c30d4 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/richtext.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/richtext.coffee @@ -13,7 +13,7 @@ class App.UiElement.richtext renderAttachment = (file) => item.find('.attachments').append( App.view('generic/attachment_item')( fileName: file.filename - fileSize: App.Utils.humanFileSize( file.size ) + fileSize: App.Utils.humanFileSize(file.size) store_id: file.store_id )) item.on( @@ -30,8 +30,8 @@ class App.UiElement.richtext # delete attachment from storage App.Ajax.request( type: 'DELETE' - url: App.Config.get('api_path') + '/ticket_attachment_upload' - data: JSON.stringify( { store_id: store_id } ), + url: "#{App.Config.get('api_path')}/ticket_attachment_upload" + data: JSON.stringify(store_id: store_id), processData: false ) @@ -52,22 +52,22 @@ class App.UiElement.richtext @cancelContainer = item.find('.js-cancel') u = => html5Upload.initialize( - uploadUrl: App.Config.get('api_path') + '/ticket_attachment_upload', - dropContainer: item.closest('form').get(0), - cancelContainer: @cancelContainer, - inputField: item.find( 'input' ).get(0), - key: 'File', - data: { form_id: item.closest('form').find('[name=form_id]').val() }, + uploadUrl: App.Config.get('api_path') + '/ticket_attachment_upload' + dropContainer: item.closest('form').get(0) + cancelContainer: @cancelContainer + inputField: item.find('input').get(0) maxSimultaneousUploads: 1, - onFileAdded: (file) => + key: 'File' + data: + form_id: item.closest('form').find('[name=form_id]').val() + onFileAdded: (file) => file.on( - onStart: => @attachmentPlaceholder.addClass('hide') @attachmentUpload.removeClass('hide') @cancelContainer.removeClass('hide') - console.log('upload start') + App.Log.debug 'UiElement.richtext', 'upload start' onAborted: => @attachmentPlaceholder.removeClass('hide') @@ -75,7 +75,6 @@ class App.UiElement.richtext # Called after received response from the server onCompleted: (response) => - response = JSON.parse(response) @attachments.push response.data @@ -88,7 +87,7 @@ class App.UiElement.richtext renderAttachment(response.data) - console.log('upload complete', response.data ) + App.Log.debug 'UiElement.richtext', 'upload complete', response.data # Called during upload progress, first parameter # is decimal value from 0 to 100. @@ -98,8 +97,9 @@ class App.UiElement.richtext # hide cancel on 90% if parseInt(progress) >= 90 @cancelContainer.addClass('hide') - console.log('uploadProgress ', parseInt(progress)) + App.Log.debug 'UiElement.richtext', 'uploadProgress ', parseInt(progress) + ) ) - App.Delay.set( u, 100, undefined, 'form_upload' ) - item \ No newline at end of file + App.Delay.set(u, 100, undefined, 'form_upload') + item diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index 02254e44b..203fd6565 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -153,7 +153,7 @@ class App.TicketZoomArticleNew extends App.Controller @$('[data-name="body"]').ce({ mode: 'richtext' multiline: true - maxlength: 40000 + maxlength: 50000 }) html5Upload.initialize(