Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterfund-api-email
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
eterfund-api-email
Commits
783a8aee
Commit
783a8aee
authored
Nov 21, 2017
by
Дмитрий Никулин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap all JS code in IIFE to avoid creating global variables
parent
f103eaf1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
svcCheckEmail.js
svcCheckEmail.js
+18
-18
No files found.
svcCheckEmail.js
View file @
783a8aee
var
noticeTimer
,
noticeShow
=
false
;
(
function
()
{
var
noticeTimer
,
noticeShow
=
false
;
function
getEMail
()
{
function
getEMail
()
{
var
emailInput
=
$
(
'.svcCheckEmail'
);
var
email
=
emailInput
.
val
();
try
{
...
...
@@ -10,18 +11,18 @@ function getEMail()
//
}
return
email
;
}
}
function
closeNotice
()
{
function
closeNotice
()
{
if
(
noticeShow
===
true
)
{
clearTimeout
(
noticeTimer
);
emailNotice
.
animate
({
marginTop
:
'-=51px'
},
300
);
noticeShow
=
false
;
}
}
}
function
showNotice
(
type
,
message
)
{
function
showNotice
(
type
,
message
)
{
if
(
!
document
.
getElementById
(
'svcCheckEmail_notice'
))
{
var
notice
=
'<div id="svcCheckEmail_notice"><div class="notice_center_auto">'
;
notice
+=
'<div id="notice_text"></div>'
;
...
...
@@ -47,10 +48,10 @@ function showNotice(type, message) {
emailNotice
.
animate
({
marginTop
:
'-=51px'
},
300
);
noticeShow
=
false
;
},
7000
);
}
}
function
showErrorNotice
(
error
)
{
function
showErrorNotice
(
error
)
{
var
noticeText
;
switch
(
error
)
{
case
'dns_records_not_found'
:
...
...
@@ -71,11 +72,11 @@ function showErrorNotice(error)
break
;
}
showNotice
(
'red'
,
noticeText
);
}
}
// Добавляем CSS и расставляем вызов
$
(
function
()
{
// Добавляем CSS и расставляем вызов
$
(
function
()
{
$
(
'<link />'
).
attr
({
rel
:
'stylesheet'
,
type
:
'text/css'
,
...
...
@@ -159,8 +160,7 @@ $(function() {
error
:
function
()
{
showNotice
(
'red'
,
'Ошибка связи с сервером, проверка адреса не удалась.'
);
emailInput
.
removeClass
(
'bg-loader'
).
addClass
(
'bg-true'
);
// FIXME
// FIXME
checkDoneStatus
=
'true'
;
},
success
:
function
(
response
)
{
...
...
@@ -185,7 +185,7 @@ $(function() {
checkDoneStatus
=
'done'
;
}
// FIXME
// FIXME
}
catch
(
e
)
{
showNotice
(
'yellow'
,
'Не удалось проверить адрес e-mail.'
);
emailInput
.
removeClass
(
'bg-loader'
).
addClass
(
'bg-true'
);
...
...
@@ -194,7 +194,7 @@ $(function() {
}
});
return
true
;
});
});
});
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment