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 // pagination
$.fn.xePagination = function(){ $.fn.xePagination = function(){
this this
.not('.xe-pagination')
.addClass('xe-pagination')
.find('span.tgContent').css('whiteSpace', 'nowrap').end() .find('span.tgContent').css('whiteSpace', 'nowrap').end()
.find('a.tgAnchor') .find('a.tgAnchor')
.each(function(idx){ .each(function(idx){
@ -151,6 +153,30 @@ jQuery(function($){
// Display all sections then hide this button // Display all sections then hide this button
$(this).hide().parent().prevAll('.section').show(); $(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 // Modal Window

View file

@ -60,7 +60,7 @@
<tr loop="$member_list=>$no,$member_info"> <tr loop="$member_list=>$no,$member_info">
{@$member_info = get_object_vars($member_info)} {@$member_info = get_object_vars($member_info)}
<td> <td>
<span class="member_{$member_info['member_srl']}">{getEncodeEmailAddress($member_info['email_address'])}</span> <span class="member_{$member_info['member_srl']} masked">{getEncodeEmailAddress($member_info['email_address'])}</span>
</td> </td>
{@ $member_info['group_list'] = implode(', ', $member_info['group_list'])} {@ $member_info['group_list'] = implode(', ', $member_info['group_list'])}
<td loop="$usedIdentifiers=>$name,$title">{$member_info[$name]}</td> <td loop="$usedIdentifiers=>$name,$title">{$member_info[$name]}</td>