Roo.extend(Roo.htmleditor.FilterBlack, Roo.htmleditor.Filter,
{
-Roo.htmleditor.FilterBlack = {
+ tag : true, // all elements.
/**
* @cfg {array} black blacklist of elements
*/
black : false, // array
- walkWith : function(node, black)
- {
- this.black = black;
- this.walk(node);
- },
-
-
- walk : function (node)
- {
- Roo.htmleditor.Filter.walk.call(this, node, this.black);
- },
-
replace : function(n)
{
n.parentNode.removeChild(n);
}
-};
+});
/**
- * Filter Comments
- *
- * Remove Comments..
- *
- *
- *
- *
+ * @class Roo.htmleditor.FilterComment
+ * remove comments.
+ * @constructor
+* Run a new Comments Filter
+* @param {Object} config Configuration options
*/
+Roo.htmleditor.FilterComment = function(cfg)
+{
+ this.walk(cfg.node);
+}
-Roo.htmleditor.FilterComment = {
-
-
- walk : function (node)
- {
- Roo.htmleditor.Filter.walk.call(this, node, false);
-
- },
+Roo.extend(Roo.htmleditor.FilterComment, Roo.htmleditor.Filter,
+{
+
replaceComment : function(n)
{
- n.parentNode.removeChild(n);
+ n.parentNode.removeChild(n);
}
-}
\ No newline at end of file
+});
\ No newline at end of file
/**
- * remove tags but keep children
+ * @class Roo.htmleditor.FilterKeepChildren
+ * remove tags but keep children
+ * @constructor
+ * Run a new Keep Children Filter
+ * @param {Object} config Configuration options
*/
-Roo.htmleditor.FilterKeepChildren = {
+
+Roo.htmleditor.FilterKeepChildren = function(cfg)
+{
+ Roo.apply(this, cfg);
+ this.walk(cfg.node);
+}
+
+Roo.extend(Roo.htmleditor.FilterKeepChildren, Roo.htmleditor.FilterBlack,
+{
- black : false, // array
- walkWith : function (node, black)
- {
- this.black = black;
- this.walk(node);
-
- },
- walk : function (node)
- {
- Roo.htmleditor.Filter.walk.call(this, node, this.black);
-
- },
-
-
- replace : function(n)
+
+ replaceTag : function(n)
{
// walk children...
for (var i = 0; i < node.childNodes.length; i++) {
/**
- * Filter Paragraph
- *
+ * @class Roo.htmleditor.FilterParagraph
* paragraphs cause a nightmare for shared content - this filter is designed to be called ? at various points when editing
* like on 'push' to remove the <p> tags and replace them with line breaks.
- *
- *
- *
+ * @constructor
+ * Run a new Paragraph Filter
+ * @param {Object} config Configuration options
*/
-Roo.htmleditor.FilterParagraph = {
+Roo.htmleditor.FilterParagraph = function(cfg)
+{
+ // no need to apply config.
+ this.walk(cfg.node);
+}
+
+Roo.extend(Roo.htmleditor.FilterParagraph, Roo.htmleditor.Filter,
+{
- walk : function (body)
- {
- Roo.htmleditor.Filter.walk.call(this, body, 'P');
-
- },
+ tag : 'P',
+
- replace : function(node)
+ replaceTag : function(node)
{
if (node.childNodes.length == 1 &&
-
/**
- * filter span's with no attributes out..
+ * @class Roo.htmleditor.FilterSpan
+ * filter span's with no attributes out..
+ * @constructor
+ * Run a new Span Filter
+ * @param {Object} config Configuration options
*/
-Roo.htmleditor.FilterSpan = {
+Roo.htmleditor.FilterSpan = function(cfg)
+{
+ // no need to apply config.
+ this.walk(cfg.node);
+}
- walk : function (node)
- {
- Roo.htmleditor.Filter.walk.call(this, 'SPAN', true );
+Roo.extend(Roo.htmleditor.FilterSpan, Roo.htmleditor.Filter,
+{
+
+ tag : 'SPAN',
- },
- replace : function(node)
+
+ replaceTag : function(node)
{
if (node.attributes && node.attributes.length > 0) {
this.walk(node);
}
-};
\ No newline at end of file
+});
\ No newline at end of file
/**
- *
- * try and remove table width data - as that frequently messes up other stuff.
+ * @class Roo.htmleditor.FilterTableWidth
+ try and remove table width data - as that frequently messes up other stuff.
*
* was cleanTableWidths.
*
* Quite often pasting from word etc.. results in tables with column and widths.
* This does not work well on fluid HTML layouts - like emails. - so this code should hunt an destroy them..
*
+ * @constructor
+ * Run a new Table Filter
+ * @param {Object} config Configuration options
*/
-Roo.htmleditor.FilterParagraph = {
-
- walk: function (body)
- {
- Roo.htmleditor.Filter.walk.call(this, body, ['TABLE', 'TD', 'TR', 'TH', 'THEAD', 'TBODY' ]);
- },
-
+Roo.htmleditor.FilterTableWidth = function(cfg)
+{
+ // no need to apply config.
+ this.tag = ['TABLE', 'TD', 'TR', 'TH', 'THEAD', 'TBODY' ];
+ this.walk(cfg.node);
+}
+
+Roo.extend(Roo.htmleditor.FilterTableWidth, Roo.htmleditor.Filter,
+{
+
+
- replace: function(node) {
+ replaceTag: function(node) {
this.walk(node);
}
-};
\ No newline at end of file
+});
\ No newline at end of file
/**
- *
+ * @class Roo.htmleditor.FilterWord
* try and clean up all the mess that Word generates.
*
* This is the 'nice version' - see 'Heavy' that white lists a very short list of elements, and multi-filters
- *
+
+ * @constructor
+ * Run a new Span Filter
+ * @param {Object} config Configuration options
*/
-Roo.htmleditor.FilterWord = {
-
- walk: function (node)
- {
- Roo.htmleditor.Filter.walk.call(this, node, true);
- },
+
+Roo.htmleditor.FilterWord = function(cfg)
+{
+ // no need to apply config.
+ this.walk(cfg.node);
+}
+
+Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
+{
+ tag: true,
+
/**
* Clean up MS wordisms...
*/
- replace : function(node)
+ replaceTag : function(node)
{
// no idea what this does - span with text, replaceds with just text.
node.removeChild(cn);
node.parentNode.insertBefore(cn, node);
// move node to parent - and clean it..
- this.replace(cn);
+ this.replaceTag(cn);
}
node.parentNode.removeChild(node);
/// no need to iterate chidlren = it's got none..
"tree_children" : [],
"tree_parent" : []
},
+ "Roo.htmleditor.FilterBlack" : {
+ "props" : [
+ {
+ "name" : "black",
+ "type" : "array",
+ "desc" : "blacklist of elements",
+ "memberOf" : ""
+ }
+ ],
+ "events" : [],
+ "methods" : [],
+ "isAbstract" : false,
+ "isBuilderTop" : false,
+ "implementations" : [],
+ "tree_children" : [],
+ "tree_parent" : []
+ },
"Roo.lib" : {
"props" : [],
"events" : [],
* @class Roo.htmleditor.FilterAttributes
* clean attributes and styles including http:// etc.. in attribute
* @constructor
- * Create a new Filter.
- * @param {Object} config Configuration options
+* Run a new Attribute Filter
+* @param {Object} config Configuration options
*/
</span><span class="jsdoc-var">Roo.htmleditor.FilterAttributes </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">)
{
*
*/
-</span><span class="jsdoc-var">Roo.htmleditor.FilterBlack </span><span class="jsdoc-syntax">= {
+/**
+ * @class Roo.htmleditor.FilterBlack
+ * remove blacklisted elements.
+ * @constructor
+ * Run a new Blacklisted Filter
+ * @param {Object} config Configuration options
+ */
+
+</span><span class="jsdoc-var">Roo.htmleditor.FilterBlack </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">)
+{
+ </span><span class="jsdoc-var">Roo.apply</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">);
+ </span><span class="jsdoc-var">this.walk</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">cfg.node</span><span class="jsdoc-syntax">);
+}
+</span><span class="jsdoc-var">Roo.extend</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">Roo.htmleditor.FilterBlack</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.htmleditor.Filter</span><span class="jsdoc-syntax">,
+{
+</span><span class="jsdoc-var">Roo.htmleditor.FilterBlack </span><span class="jsdoc-syntax">= {
+ </span><span class="jsdoc-comment">/**
+ * @cfg {array} black blacklist of elements
+ */
</span><span class="jsdoc-var">black </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">, </span><span class="jsdoc-comment">// array
+
</span><span class="jsdoc-var">walkWith </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">node</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">black</span><span class="jsdoc-syntax">)
{
</span><span class="jsdoc-var">this.black </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">black</span><span class="jsdoc-syntax">;
"name" : "Roo.htmleditor.FilterAttributes",
"cn" : [],
"is_class" : false
+ },
+ {
+ "name" : "Roo.htmleditor.FilterBlack",
+ "cn" : [],
+ "is_class" : false
}
],
"is_class" : false