diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-01-20 00:55:51 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-01-20 00:55:51 +0100 |
commit | c63493c899de714b05b0521bb38aab60d19030ef (patch) | |
tree | fcb2b261afa0f3c2bd6b48929b64724c71192bae /sources/core/dom/comment.js | |
download | ludivine-ckeditor-component-c63493c899de714b05b0521bb38aab60d19030ef.tar.gz ludivine-ckeditor-component-c63493c899de714b05b0521bb38aab60d19030ef.tar.zst ludivine-ckeditor-component-c63493c899de714b05b0521bb38aab60d19030ef.zip |
Validation initiale4.6.2.1
Diffstat (limited to 'sources/core/dom/comment.js')
-rw-r--r-- | sources/core/dom/comment.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sources/core/dom/comment.js b/sources/core/dom/comment.js new file mode 100644 index 0000000..4abb453 --- /dev/null +++ b/sources/core/dom/comment.js | |||
@@ -0,0 +1,53 @@ | |||
1 | /** | ||
2 | * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | /** | ||
7 | * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents | ||
8 | * a DOM comment node. | ||
9 | */ | ||
10 | |||
11 | /** | ||
12 | * Represents a DOM comment node. | ||
13 | * | ||
14 | * var nativeNode = document.createComment( 'Example' ); | ||
15 | * var comment = new CKEDITOR.dom.comment( nativeNode ); | ||
16 | * | ||
17 | * var comment = new CKEDITOR.dom.comment( 'Example' ); | ||
18 | * | ||
19 | * @class | ||
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. | ||
26 | */ | ||
27 | CKEDITOR.dom.comment = function( comment, ownerDocument ) { | ||
28 | if ( typeof comment == 'string' ) | ||
29 | comment = ( ownerDocument ? ownerDocument.$ : document ).createComment( comment ); | ||
30 | |||
31 | CKEDITOR.dom.domObject.call( this, comment ); | ||
32 | }; | ||
33 | |||
34 | CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node(); | ||
35 | |||
36 | CKEDITOR.tools.extend( CKEDITOR.dom.comment.prototype, { | ||
37 | /** | ||
38 | * The node type. This is a constant value set to {@link CKEDITOR#NODE_COMMENT}. | ||
39 | * | ||
40 | * @readonly | ||
41 | * @property {Number} [=CKEDITOR.NODE_COMMENT] | ||
42 | */ | ||
43 | type: CKEDITOR.NODE_COMMENT, | ||
44 | |||
45 | /** | ||
46 | * Gets the outer HTML of this comment. | ||
47 | * | ||
48 | * @returns {String} The HTML `<!-- comment value -->`. | ||
49 | */ | ||
50 | getOuterHtml: function() { | ||
51 | return '<!--' + this.$.nodeValue + '-->'; | ||
52 | } | ||
53 | } ); | ||