Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-webclient
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
retypos-webclient
Commits
88b9d60e
Commit
88b9d60e
authored
Apr 18, 2012
by
Владислав Большаков
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
barbass: шаблон и управляющий скрипт
parents
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
default.php
default.php
+29
-0
etersoft_typos.js
etersoft_typos.js
+53
-0
No files found.
default.php
0 → 100644
View file @
88b9d60e
<html>
<head>
<meta
charset=
"utf-8"
/>
<script
src=
"etersoft_typos.js"
></script>
</head>
<body>
<div
id=
"e_typos_div"
style=
"display:none;"
>
<table>
<a
href=
"javascript:void(0)"
onclick=
"e_typos_close()"
>
Закрыть
</a>
<tr>
<td>
Введите капчу:
</td>
<td>
тут будет капча
</td>
</tr>
<tr>
<td
title=
"Не обязательное поле"
>
Ваш email:
</td>
<td><input
type=
'email'
name=
'e_typos_email'
id=
'e_typos_email'
></td>
</tr>
<tr>
<td
colspan=
"2"
align=
"center"
><div
id=
"e_typos_error"
style=
"display:none;"
></div></td>
</tr>
<tr>
<td
colspan=
"2"
align=
"center"
><input
type=
"button"
onclick=
"e_typos_post_data()"
value=
"Отправить"
></td>
</tr>
</table>
</div>
</br>
<p>
Ехал грека через реку
</p>
</body>
etersoft_typos.js
0 → 100644
View file @
88b9d60e
/* Плагин: сервис опечаток от компании Etersoft
* email: info@etersoft.ru
* автор: barbass@etersoft.ru
* дата: 2012-04-18
*/
window
.
document
.
onkeydown
=
function
(
e
)
{
if
(
e
.
ctrlKey
==
1
&&
e
.
keyCode
==
69
)
{
e_typos_control_panel
();
}
}
function
e_typos_control_panel
()
{
if
(
document
.
getElementById
(
"e_typos_div"
).
style
.
display
==
"block"
)
{
e_typos_close
();
}
else
{
e_typos_div
();
}
}
function
e_typos_div
()
{
document
.
getElementById
(
"e_typos_error"
).
style
.
display
=
"none"
;
document
.
getElementById
(
"e_typos_div"
).
style
.
display
=
"block"
;
}
function
e_typos_close
()
{
document
.
getElementById
(
"e_typos_div"
).
style
.
display
=
"none"
;
}
function
e_typos_post_data
()
{
var
this_url
=
window
.
location
.
href
;
//Текущая страница
var
select_text
=
String
(
document
.
getSelection
());
//Выделенный текст
var
user_email
=
document
.
getElementById
(
"e_typos_email"
).
value
;
if
(
user_email
==
''
)
{
user_email
=
"не указан"
;
}
if
(
select_text
.
length
==
0
)
{
e_typos_error
(
"red"
,
"Вы ничего не выделили"
);
}
else
if
(
select_text
.
length
<=
5
)
{
e_typos_error
(
"red"
,
"Выделенный текст слишком короток"
);
}
else
{
//Ajax-запрос
e_typos_error
(
"green"
,
"Ваш текст:"
+
select_text
+
"<br/>Спасибо за ваше внимание"
);
}
}
function
e_typos_error
(
error
,
text
)
{
document
.
getElementById
(
"e_typos_error"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"e_typos_error"
).
innerHTML
=
text
;
document
.
getElementById
(
"e_typos_error"
).
style
.
color
=
error
;
}
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