Roo/htmleditor/FilterFileWarning.js
[roojs1] / Roo / htmleditor / FilterFileWarning.js
1
2 /**
3  * @class Roo.htmleditor.FilterAttributes
4  * clean attributes and  styles including http:// etc.. in attribute
5  * @constructor
6 * Run a new Attribute Filter
7 * @param {Object} config Configuration options
8  */
9 Roo.htmleditor.FilterFileWarning = function(cfg)
10 {
11     
12     var atag = cfg.node.getElementsByTagName('a');
13     for(var i =0; i < atags.length;i++) {
14         var str = '' + atags.item(i).getAttribute('href');
15         if (str.match(/^file:/)) {
16             throw new Exception ("got file url");
17         }
18     }
19     // less likely
20     atag = cfg.node.getElementsByTagName('img');
21     for(var i =0; i < atags.length;i++) {
22         var str = '' + atags.item(i).getAttribute('src');
23         if (str.match(/^file:/)) {
24             throw new Exception ("got file url");
25         }
26     }
27 }