// closure these in so they are only created once.
var alpha = /^[a-zA-Z_]+$/;
var alphanum = /^[a-zA-Z0-9_]+$/;
- var email = /^([\w-]+)(\.[\w-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;
+ var email = /^([\w'-]+)(\.[\w'-]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;
var url = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
var urlWeb = /^((https?):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
this.picker().hide();
this.viewMode = this.startViewMode;
this.showMode();
+
+ this.inputEl().blur();
this.fireEvent('hidepopup', this, this.date);
{
this.picker().hide();
this.pop.hide();
+
+ this.inputEl().blur();
this.fireEvent('hide', this, this.time);
},
node.parentNode.removeChild(node);
},
- walkTag : function(dom)
+ searchTag : function(dom)
{
if(this.tag === false) {
return;
}
- var elements = dom.getElementsByTagName(this.tag);
- Roo.each(Array.from(elements), function(e) {
- if (this.replaceTag && false === this.replaceTag(e)) {
- return;
+ var els = dom.getElementsByTagName(this.tag);
+
+ Roo.each(Array.from(els), function(e){
+ Roo.log(e);
+ if(this.replaceTag) {
+ this.replaceTag(e);
}
}, this);
}
Roo.htmleditor.FilterParagraph = function(cfg)
{
// no need to apply config.
- this.walkTag(cfg.node);
+ this.searchTag(cfg.node);
}
Roo.extend(Roo.htmleditor.FilterParagraph, Roo.htmleditor.Filter,
{
// no need to apply config.
// this.walk(cfg.node);
- this.walkTag(cfg.node);
+ this.searchTag(cfg.node);
}
Roo.extend(Roo.htmleditor.FilterHashLink, Roo.htmleditor.Filter,
var a = node.attributes[i];
if(a.name.toLowerCase() == 'href' && a.value.startsWith('#')) {
- var ar = Array.from(node.childNodes);
- for (var i = 0; i < ar.length; i++) {
- node.parentNode.insertBefore(ar[i], node);
- }
-
- node.parentNode.removeChild(node);
+ this.removeNodeKeepChildren(node);
}
}
Roo.htmleditor.FilterSpan = function(cfg)
{
// no need to apply config.
- this.walkTag(cfg.node);
+ this.searchTag(cfg.node);
}
Roo.extend(Roo.htmleditor.FilterSpan, Roo.htmleditor.FilterKeepChildren,
Roo.htmleditor.FilterLongBr = function(cfg)
{
// no need to apply config.
- this.walkTag(cfg.node);
+ this.searchTag(cfg.node);
}
Roo.extend(Roo.htmleditor.FilterLongBr, Roo.htmleditor.Filter,
-
-
if (!node.previousSibling) {
return false;
}