Make masked fields

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9074 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-09-07 04:47:26 +00:00
parent 4a2b404c46
commit bf4e418be6
2 changed files with 27 additions and 1 deletions

View file

@ -99,6 +99,8 @@ jQuery(function($){
// pagination
$.fn.xePagination = function(){
this
.not('.xe-pagination')
.addClass('xe-pagination')
.find('span.tgContent').css('whiteSpace', 'nowrap').end()
.find('a.tgAnchor')
.each(function(idx){
@ -151,6 +153,30 @@ jQuery(function($){
// Display all sections then hide this button
$(this).hide().parent().prevAll('.section').show();
});
$.fn.xeMask = function(){
this
.each(function(){
var $this = $(this), text = $this.text();
var reg_mail = /^([\w\-\.]+?)@(([\w-]+\.)+[a-z]{2,})$/ig;
$this.data('originalText', text);
if(reg_mail.test(text)) {
$this.data('maskedText', RegExp.$1+'...');
}
$this.text( $this.data('maskedText') );
})
.mouseover(function(){
$(this).text( $(this).data('originalText') );
})
.mouseout(function(){
$(this).text( $(this).data('maskedText') );
})
.focus(function(){ $(this).mouseover(); })
.blur(function(){ $(this).mouseout(); });
};
$('.masked').xeMask();
});
// Modal Window