From 6e6da8e000be1865d3cb0f8139220e99d137f0e4 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 26 Sep 2013 21:35:05 +0000 Subject: [PATCH] paste text/plain instead of html in Ox.EditableContent --- source/Ox.UI/js/Form/EditableContent.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Ox.UI/js/Form/EditableContent.js b/source/Ox.UI/js/Form/EditableContent.js index 57d0f72f..b7dbc462 100644 --- a/source/Ox.UI/js/Form/EditableContent.js +++ b/source/Ox.UI/js/Form/EditableContent.js @@ -87,6 +87,14 @@ Ox.EditableContent = function(options, self) { }, paste: function(e) { Ox.print('PASTE', e); + if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) { + Ox.print('TYPES', e.originalEvent.clipboardData.types); + var value = e.originalEvent.clipboardData.getData('text/plain'); + document.execCommand('insertHTML', false, value); + e.originalEvent.stopPropagation(); + e.originalEvent.preventDefault(); + return false; + } } }) .bindEvent({