JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.5
[ckeditor.git] / _source / plugins / styles / plugin.js
index 2c16b7e..b0dab59 100644 (file)
@@ -90,6 +90,16 @@ CKEDITOR.STYLE_OBJECT = 3;
 \r
        CKEDITOR.style = function( styleDefinition, variablesValues )\r
        {\r
+               // Inline style text as attribute should be converted\r
+               // to styles object.\r
+               var attrs = styleDefinition.attributes;\r
+               if ( attrs && attrs.style )\r
+               {\r
+                       styleDefinition.styles = CKEDITOR.tools.extend( {},\r
+                               styleDefinition.styles, parseStyleText( attrs.style ) );\r
+                       delete attrs.style;\r
+               }\r
+\r
                if ( variablesValues )\r
                {\r
                        styleDefinition = CKEDITOR.tools.clone( styleDefinition );\r
@@ -218,9 +228,8 @@ CKEDITOR.STYLE_OBJECT = 3;
                        return true;\r
                },\r
 \r
-               // Checks if an element, or any of its attributes, is removable by the\r
-               // current style definition.\r
-               checkElementRemovable : function( element, fullMatch )\r
+               // Check if the element matches the current style definition.\r
+               checkElementMatch : function( element, fullMatch )\r
                {\r
                        var def = this._.definition;\r
 \r
@@ -266,10 +275,23 @@ CKEDITOR.STYLE_OBJECT = 3;
                                        return true;\r
                        }\r
 \r
-                       // Check if the element can be somehow overriden.\r
+                       return false;\r
+               },\r
+\r
+               // Checks if an element, or any of its attributes, is removable by the\r
+               // current style definition.\r
+               checkElementRemovable : function( element, fullMatch )\r
+               {\r
+                       // Check element matches the style itself.\r
+                       if ( this.checkElementMatch( element, fullMatch ) )\r
+                               return true;\r
+\r
+                       // Check if the element matches the style overrides.\r
                        var override = getOverrides( this )[ element.getName() ] ;\r
                        if ( override )\r
                        {\r
+                               var attribs, attName;\r
+\r
                                // If no attributes have been defined, remove the element.\r
                                if ( !( attribs = override.attributes ) )\r
                                        return true;\r