]>
git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/core/dom/comment.js
69828c2e1dfa4ee581e31de88598f7caf7645a00
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents
12 * Represents a DOM comment node.
14 * var nativeNode = document.createComment( 'Example' );
15 * var comment = new CKEDITOR.dom.comment( nativeNode );
17 * var comment = new CKEDITOR.dom.comment( 'Example' );
20 * @extends CKEDITOR.dom.node
21 * @constructor Creates a comment class instance.
22 * @param {Object/String} comment A native DOM comment node or a string containing
23 * the text to use to create a new comment node.
24 * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain
25 * the node in case of new node creation. Defaults to the current document.
27 CKEDITOR
.dom
.comment = function( comment
, ownerDocument
) {
28 if ( typeof comment
== 'string' )
29 comment
= ( ownerDocument
? ownerDocument
.$ : document
).createComment( comment
);
31 CKEDITOR
.dom
.domObject
.call( this, comment
);
34 CKEDITOR
.dom
.comment
.prototype = new CKEDITOR
.dom
.node();
36 CKEDITOR
.tools
.extend( CKEDITOR
.dom
.comment
.prototype, {
38 * The node type. This is a constant value set to {@link CKEDITOR#NODE_COMMENT}.
41 * @property {Number} [=CKEDITOR.NODE_COMMENT]
43 type: CKEDITOR
.NODE_COMMENT
,
46 * Gets the outer HTML of this comment.
48 * @returns {String} The HTML `<!-- comment value -->`.
50 getOuterHtml: function() {
51 return '<!--' + this.$.nodeValue
+ '-->';