JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / plugins / forms / plugin.js
index 3be5c3b..cd3831c 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -9,6 +9,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 CKEDITOR.plugins.add( 'forms',\r
 {\r
+       requires : [ 'dialog' ],\r
        init : function( editor )\r
        {\r
                var lang = editor.lang;\r
@@ -261,24 +262,28 @@ CKEDITOR.plugins.add( 'forms',
 \r
 if ( CKEDITOR.env.ie )\r
 {\r
-       CKEDITOR.dom.element.prototype.hasAttribute = function( name )\r
-       {\r
-               var $attr = this.$.attributes.getNamedItem( name );\r
-\r
-               if ( this.getName() == 'input' )\r
+       CKEDITOR.dom.element.prototype.hasAttribute = CKEDITOR.tools.override( CKEDITOR.dom.element.prototype.hasAttribute,\r
+               function( original )\r
                {\r
-                       switch ( name )\r
-                       {\r
-                               case 'class' :\r
-                                       return this.$.className.length > 0;\r
-                               case 'checked' :\r
-                                       return !!this.$.checked;\r
-                               case 'value' :\r
-                                       var type = this.getAttribute( 'type' );\r
-                                       return type == 'checkbox' || type == 'radio' ? this.$.value != 'on' : this.$.value;\r
-                       }\r
-               }\r
+                       return function( name )\r
+                               {\r
+                                       var $attr = this.$.attributes.getNamedItem( name );\r
+\r
+                                       if ( this.getName() == 'input' )\r
+                                       {\r
+                                               switch ( name )\r
+                                               {\r
+                                                       case 'class' :\r
+                                                               return this.$.className.length > 0;\r
+                                                       case 'checked' :\r
+                                                               return !!this.$.checked;\r
+                                                       case 'value' :\r
+                                                               var type = this.getAttribute( 'type' );\r
+                                                               return type == 'checkbox' || type == 'radio' ? this.$.value != 'on' : this.$.value;\r
+                                               }\r
+                                       }\r
 \r
-               return !!( $attr && $attr.specified );\r
-       };\r
+                                       return original.apply( this, arguments );\r
+                               };\r
+               });\r
 }\r