JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.3
[ckeditor.git] / _source / plugins / htmldataprocessor / plugin.js
index 264f504..8a17828 100644 (file)
@@ -84,6 +84,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        delete blockLikeTags.pre;\r
        var defaultDataFilterRules =\r
        {\r
+               elements : {},\r
                attributeNames :\r
                [\r
                        // Event attributes (onXYZ) must not be directly set. They can become\r
@@ -240,6 +241,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                };\r
        }\r
 \r
+       function protectReadOnly( element )\r
+       {\r
+               element.attributes.contenteditable = "false";\r
+       }\r
+       function unprotectReadyOnly( element )\r
+       {\r
+               delete element.attributes.contenteditable;\r
+       }\r
+       // Disable form elements editing mode provided by some browers. (#5746)\r
+       for ( i in { input : 1, textarea : 1 } )\r
+       {\r
+               defaultDataFilterRules.elements[ i ] = protectReadOnly;\r
+               defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly;\r
+       }\r
+\r
        var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;\r
 \r
        var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,\r