/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
* a DOM comment node.\r
*/\r
\r
-CKEDITOR.dom.comment = CKEDITOR.tools.createClass(\r
+/**\r
+ * Represents a DOM comment node.\r
+ * @constructor\r
+ * @augments CKEDITOR.dom.node\r
+ * @param {Object|String} comment A native DOM comment node or a string containing\r
+ * the text to use to create a new comment node.\r
+ * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain\r
+ * the node in case of new node creation. Defaults to the current document.\r
+ * @example\r
+ * var nativeNode = document.createComment( 'Example' );\r
+ * var comment = CKEDITOR.dom.comment( nativeNode );\r
+ * @example\r
+ * var comment = CKEDITOR.dom.comment( 'Example' );\r
+ */\r
+CKEDITOR.dom.comment = function( comment, ownerDocument )\r
{\r
- base : CKEDITOR.dom.node,\r
+ if ( typeof comment == 'string' )\r
+ comment = ( ownerDocument ? ownerDocument.$ : document ).createComment( comment );\r
\r
- $ : function( text, ownerDocument )\r
- {\r
- if ( typeof text == 'string' )\r
- text = ( ownerDocument ? ownerDocument.$ : document ).createComment( text );\r
+ CKEDITOR.dom.domObject.call( this, comment );\r
+};\r
\r
- this.base( text );\r
- },\r
+CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node();\r
\r
- proto :\r
+CKEDITOR.tools.extend( CKEDITOR.dom.comment.prototype,\r
+ /** @lends CKEDITOR.dom.comment.prototype */\r
{\r
type : CKEDITOR.NODE_COMMENT,\r
\r
{\r
return '<!--' + this.$.nodeValue + '-->';\r
}\r
- }\r
-});\r
+ });\r