浏览代码

Bug fix: don't accept attachments (like images) via Chrome's copy/paste since it may duplicate the text content of a normal copy/paste and moreover causes troubles because there is no file name associated with the pasted content.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3621 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 年之前
父节点
当前提交
a6960f1c0d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      datamodels/2.x/itop-attachments/main.attachments.php

+ 2 - 0
datamodels/2.x/itop-attachments/main.attachments.php

@@ -250,6 +250,7 @@ EOF
 		$('#attachment_plugin').trigger('remove_attachment', [att_id]);
 		$('#attachment_plugin').trigger('remove_attachment', [att_id]);
 		return false; // Do not submit the form !
 		return false; // Do not submit the form !
 	}
 	}
+				
 	function ajaxFileUpload()
 	function ajaxFileUpload()
 	{
 	{
 		//starting setting some animation when the ajax starts and completes
 		//starting setting some animation when the ajax starts and completes
@@ -368,6 +369,7 @@ $oPage->add_ready_script(
 		url: GetAbsoluteUrlModulesRoot()+'itop-attachments/ajax.attachment.php',
 		url: GetAbsoluteUrlModulesRoot()+'itop-attachments/ajax.attachment.php',
 		formData: { operation: 'add', temp_id: '$sTempId', obj_class: '$sClass' },
 		formData: { operation: 'add', temp_id: '$sTempId', obj_class: '$sClass' },
         dataType: 'json',
         dataType: 'json',
+		pasteZone: null, // Don't accept files via Chrome's copy/paste
         done: function (e, data) {
         done: function (e, data) {
 			if(typeof(data.result.error) != 'undefined')
 			if(typeof(data.result.error) != 'undefined')
 			{
 			{