mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-26 16:47:54 +08:00
Code improving
This commit is contained in:
parent
b7af645cbc
commit
f180c2fbec
3 changed files with 18 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 RainLoop Team
|
||||
Copyright (c) 2013 https://github.com/sharq88
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
|
|
|
@ -9,5 +9,4 @@ class ParseExcelListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
$this->addJs('js/parse_excel_list.js'); // add js file
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
|
||||
$(function () {
|
||||
(function(window, $) {
|
||||
|
||||
//selectors
|
||||
var inputs = '.popups .inputosaurus-input input[type="text"]:first, \
|
||||
.popups .cc-row input[type="text"]:first, \
|
||||
.popups .bcc-row input[type="text"]:first';
|
||||
$(function() {
|
||||
|
||||
$(window.document).on('keyup', '.b-compose .b-header .inputosaurus-input input[type="text"]:first', function() {
|
||||
|
||||
var
|
||||
$this = $(this),
|
||||
value = $this.val()
|
||||
;
|
||||
|
||||
if (value && value.match(/@/ig).length >= 2)
|
||||
{
|
||||
$this.val($this.val().replace(/\n| /ig, ','));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//bind function
|
||||
$(document).on( 'keyup', inputs, function(){
|
||||
var t = $(this);
|
||||
var v = t.val();
|
||||
if( v != "" && v.match(/@/ig).length >= 2 ){
|
||||
t.val( t.val().replace(/\n| /ig,",") )
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}(window, $))
|
Loading…
Reference in a new issue